0.4.0 • Published 7 years ago
maf-config-from-json v0.4.0
maf-config-from-json
maf-config plugin for node.js, get config from json files
install
npm install maf-config-from-json
usage
var Config = require('maf-config');
var jsonPlugin = require('maf-config-from-json');
var config = new Config();
config
.use(jsonPlugin)
.from('/configs/config.json', '.')
.from('/configs/api.json', 'api')
.from('/configs/db.json', 'db')
.init()
.then(() => {
console.log(config.get('api.test')));
})
.catch((error) => {
logger.error(error);
});
LICENSE
MIT