2.0.1 • Published 7 years ago

xconfigjs v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

xconfigjs

A super simple & flexible & useful config module.

Install

npm i xconfigjs --save

Usage

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=3000

Test

npm test

License

MIT