forked from hybridgroup/cylon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (27 loc) · 819 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
var MCP = require("./lib/mcp");
module.exports = {
MCP: require("./lib/mcp"),
Robot: require("./lib/robot"),
Driver: require("./lib/driver"),
Adaptor: require("./lib/adaptor"),
Utils: require("./lib/utils"),
Logger: require("./lib/logger"),
IO: {
DigitalPin: require("./lib/io/digital-pin"),
Utils: require("./lib/io/utils")
},
robot: MCP.create,
api: require("./lib/api").create,
config: require("./lib/config").update,
start: MCP.start,
halt: MCP.halt
};
process.on("SIGINT", function() {
MCP.halt(process.kill.bind(process, process.pid));
});
if (process.platform === "win32") {
var io = { input: process.stdin, output: process.stdout },
quit = process.emit.bind(process, "SIGINT");
require("readline").createInterface(io).on("SIGINT", quit);
}