]> git.r.bdr.sh - rbdr/sorting-hat/blame_incremental - README.md
Merge branch 'feature/rbdr-initial-dev' into develop
[rbdr/sorting-hat] / README.md
... / ...
CommitLineData
1# Sorting Hat
2
3A sorting hat, sorts you to a variety of sets based on the assignment of
4mind waves.
5
6## Usage
7
8This package can be used as a standalone executable or as a library
9inside other node applications
10
11### As an executable
12
13It 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
31The 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
43You can include it in other libraries by requiring the file. For more
44information on the public API and the used data structures, please check
45`doc/README.md`
46
47```
48'use strict';
49
50const sortingHat = new SortingHat({
51 deviceLocation: '/dev/tty.MindWaveMobile-SerialPo',
52 mappingStrategy: 'tmnt',
53 port: 1987
54});
55sortingHat.start();
56```
57
58At the moment it's not built right, so you can't really do much with
59this 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