Skip to content

Instantly share code, notes, and snippets.

@geoffeg
Created March 11, 2011 01:54
Show Gist options
  • Save geoffeg/865335 to your computer and use it in GitHub Desktop.
Save geoffeg/865335 to your computer and use it in GitHub Desktop.
var util = require('util');
var fs = require('fs');
var systemConfig = (function() {
var configFilePath = __dirname + '/config.js';
var configSource = fs.readFileSync(configFilePath);
var configData = new Array();
configData = JSON.parse(configSource);
return {
set: function(key, value) {
configData[key] = value;
},
get: function(key) {
return configData[key];
}
};
})();
module.exports = systemConfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment