0.1.10 • Published 10 years ago

conf-env v0.1.10

Weekly downloads
3
License
MIT
Repository
github
Last release
10 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

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago