2015-11-26 05:31:31 +00:00
|
|
|
/// <reference path="typings/tsd.d.ts" />
|
|
|
|
var beautylog = require("beautylog")("os");
|
|
|
|
var addToGlobal = function(objectArg,paramName) {
|
|
|
|
global[paramName] = objectArg;
|
|
|
|
};
|
|
|
|
var smartenv:any = {}; //create smartenv object
|
|
|
|
smartenv.items = {}; // create the items object to store items to.
|
|
|
|
smartenv.makeGlobal = function() {
|
|
|
|
addToGlobal(smartenv,"smartenv");//add object smartenv as global["smartenv"]
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-28 13:36:47 +00:00
|
|
|
smartenv.info = {};
|
|
|
|
smartenv.info.node = {};
|
|
|
|
smartenv.info.node.version = process.version;
|
|
|
|
smartenv.info.print = function() {
|
2015-11-26 05:31:31 +00:00
|
|
|
var pck = require("./package.json");
|
2015-11-28 13:36:47 +00:00
|
|
|
beautylog.log("node version is " + smartenv.info.node.version + " and smartenv version is " + pck.version);
|
2015-11-26 05:31:31 +00:00
|
|
|
beautylog.log("the smartenv module currently holds the following properties:");
|
|
|
|
console.log(Object.getOwnPropertyNames(smartenv.items).sort());
|
|
|
|
};
|
|
|
|
|
|
|
|
smartenv.register = function(objectArg,paramName = "undefined") {
|
|
|
|
if (paramName == "undefined"){
|
|
|
|
beautylog.error("paramName is undefined");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
smartenv.items[paramName] = objectArg;
|
|
|
|
};
|
|
|
|
smartenv.get = function(keyName) {
|
|
|
|
return smartenv.items[keyName];
|
2015-11-28 13:49:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
smartenv.exportEnv = function() {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
smartenv.importEnv = function() {
|
|
|
|
|
|
|
|
};
|
2015-11-26 05:31:31 +00:00
|
|
|
|
|
|
|
module.exports = smartenv;
|