streamline index file

This commit is contained in:
Andrew Stewart 2015-07-15 09:49:03 -07:00
parent 3a2766bcd9
commit c7bb3dde8c
1 changed files with 21 additions and 24 deletions

View File

@ -1,36 +1,33 @@
"use strict"; "use strict";
var Config = require("./lib/config"), var MCP = require("./lib/mcp");
MCP = require("./lib/mcp"),
API = require("./lib/api");
var exports = module.exports = {}; module.exports = {
MCP: require("./lib/mcp"),
exports.MCP = require("./lib/mcp"); Robot: require("./lib/robot"),
exports.Robot = require("./lib/robot");
exports.Driver = require("./lib/driver");
exports.Adaptor = require("./lib/adaptor");
exports.Utils = require("./lib/utils"); Driver: require("./lib/driver"),
exports.Logger = require("./lib/logger"); Adaptor: require("./lib/adaptor"),
exports.IO = { Utils: require("./lib/utils"),
Logger: require("./lib/logger"),
IO: {
DigitalPin: require("./lib/io/digital-pin"), DigitalPin: require("./lib/io/digital-pin"),
Utils: require("./lib/io/utils") Utils: require("./lib/io/utils")
},
robot: MCP.create,
api: require("./lib/api").create,
config: require("./lib/config").update,
start: MCP.start,
halt: MCP.halt
}; };
exports.robot = MCP.create;
exports.start = MCP.start;
exports.halt = MCP.halt;
exports.api = API.create;
exports.config = Config.update;
process.on("SIGINT", function() { process.on("SIGINT", function() {
exports.halt(function() { MCP.halt(process.kill.bind(process, process.pid));
process.kill(process.pid);
});
}); });
if (process.platform === "win32") { if (process.platform === "win32") {