]> git.r.bdr.sh - rbdr/sorting-hat/blob - README.md
Update binary and docs
[rbdr/sorting-hat] / README.md
1 # Sorting Hat
2
3 A sorting hat, sorts you to a variety of sets based on the assignment of
4 mind waves.
5
6 ## Usage
7
8 This package can be used as a standalone executable or as a library
9 inside other node applications
10
11 ### As an executable
12
13 It can be used as a local or global installation
14
15 #### Local Install
16
17 ```
18 $ npm install sorting-hat
19 $ npx sorting-hat
20 ```
21
22 #### Global Install
23
24 ```
25 $ npm install -g sorting-hat
26 $ sorting-hat
27 ```
28
29 #### Overriding configuration in the binary
30
31 The binary uses environment variables to override the defaults
32
33 * `SORTING_HAT_DEVICE_LOCATION`: The path from where we'll listen to the
34 mindwave, defaults to `/dev/tty.MindWaveMobile-SerialPo`
35 * `SORTING_HAT_MAPPING_STRATEGY`: The strategy used to sort the waves,
36 it defaults to `tmnt`. That is also the only supported value as of
37 right now
38 * `SORTING_HAT_PORT`: The port on which we'll start the websocket server
39 to send state updates to the frontends
40
41 ### As a Library
42
43 You can include it in other libraries by requiring the file. For more
44 information on the public API and the used data structures, please check
45 `doc/README.md`
46
47 ```
48 'use strict';
49
50 const sortingHat = new SortingHat({
51 deviceLocation: '/dev/tty.MindWaveMobile-SerialPo',
52 mappingStrategy: 'tmnt',
53 port: 1987
54 });
55 sortingHat.start();
56 ```
57
58 At the moment it's not built right, so you can't really do much with
59 this mode. But you can do it.
60
61 ## Further Improvements
62
63 * Give independent weights to each wave and category so we can balance
64 * Allow actual use as a library