xconfigjs
v2.0.1
Published
A super simple & flexible & useful config module.
Maintainers
Readme
xconfigjs
A super simple & flexible & useful config module.
Install
npm i xconfigjs --saveUsage
var config = require('xconfigjs');By default, require('xconfigjs') will bubbling find config (or custom) directory from process.cwd().
See test.
After v1.0.0, support yaml config file.
Example
config/default.js
module.exports = 'default';config/test.js
module.exports = 'test';config/production.js
module.exports = 'production';====================================
node app
require('xconfigjs'); //=> 'default'NODE_ENV=test node app
require('xconfigjs'); //=> 'test'NODE_ENV=production node app
require('xconfigjs'); //=> 'production'or:
NODE_ENV=production node app --host=localhost --port=3000Test
npm testLicense
MIT
