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";
var Config = require("./lib/config"),
MCP = require("./lib/mcp"),
API = require("./lib/api");
var MCP = require("./lib/mcp");
var exports = module.exports = {};
module.exports = {
MCP: require("./lib/mcp"),
exports.MCP = require("./lib/mcp");
exports.Robot = require("./lib/robot");
exports.Driver = require("./lib/driver");
exports.Adaptor = require("./lib/adaptor");
Robot: require("./lib/robot"),
exports.Utils = require("./lib/utils");
exports.Logger = require("./lib/logger");
Driver: require("./lib/driver"),
Adaptor: require("./lib/adaptor"),
exports.IO = {
DigitalPin: require("./lib/io/digital-pin"),
Utils: require("./lib/io/utils")
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
};
exports.robot = MCP.create;
exports.start = MCP.start;
exports.halt = MCP.halt;
exports.api = API.create;
exports.config = Config.update;
process.on("SIGINT", function() {
exports.halt(function() {
process.kill(process.pid);
});
MCP.halt(process.kill.bind(process, process.pid));
});
if (process.platform === "win32") {