3.3.3 • Published 6 years ago

cnf v3.3.3

Weekly downloads
3,001
License
MIT
Repository
github
Last release
6 years ago

cnf npm version Build Status Dependency Status devDependency Status

Configuration loader.

npm install -SE cnf 

To use it simply require it:

var config = require('cnf');

console.log('port: ' + config.http.port);

It will look for a configuration file called /config/$APP_ENV.js in the current working directory and will be extended with config from global.js.

To override configs use a command line argument prefixed with app.

node example.js --app.http.port 8080

The above line override http.port with 8080

To refer to another part of the config use

{
	port: 8080,
	siteUrl: "http://localhost:$(port)" //this will be "http://localhost:8080"
}

Add a regexp using

--app.mySetting "$regexp(/myRegExp/gmi)"
3.3.3

6 years ago

3.3.2

7 years ago

3.3.1

9 years ago

3.3.0

9 years ago

3.2.0

9 years ago

3.0.1

9 years ago

3.0.0

10 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.6

10 years ago

2.1.5

10 years ago

2.1.3

11 years ago

2.1.2

11 years ago