0.1.10 • Published 9 years ago

conf-env v0.1.10

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

conf-env

NPM Version

Installation

$ npm install conf-env

API

var config = require('conf-env')();
var host = config.host;
var port = config.port;

config(options)

Create a env config helper with the given options.

The default config file path is process.cwd()/config/env/

And generator have some file like: common.js development.js production.js test.js local.js etc.

Examples

how to switch config file

If you config the env variable NODE_ENV=development,then config will use development.js and merge with common.js

On Linux

export NODE_ENV=development  

Or

export NODE_ENV=production  

how to get the config value by key

var config = require('conf-env')();
var host = config.host;
var port = config.port;

custom local.js

If you add local.js in the ~/config/env/ path ,then local config will override env config.

demo

See demo conf-env-demo

License

MIT

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago