Load and merge configuration files in js (need to export using module.exports). Can read simple ini format file and convert it to object.
var Config = require('vnfconfig').Config;
var c = new Config(['all.js', 'production.js'], __dirname + '/config');
console.log(c.host); // output 127.0.0.1
console.log(c.port); // output 8000
all.js
module.exports = {
'host' : '127.0.0.1',
'port' : 3000
};
production.js
module.exports = {
'port': 8000
};
filesarray of configuration filenamespathpath to files given above
Override obj with properties in source1, source2 and so on
Override a property in obj. Adding property if it does not exist
objobject to overridepropname of property to overridevaluevalue of the property
filenamecallback(Error, Config)passing Config if success
Sync version of ini2json
filenameReturnConfig
Create a string in ini-format of the given obj
objobject to create ini-formatted stringReturnini-formatted string
Scan entire directory for configuration files with extension .js Those files need to export an object of configurations
pathpath of the directory to scan for configurationsReturnConfig
