3.3.3 • Published 5 years ago

cnf v3.3.3

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

5 years ago

3.3.2

6 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.0

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.6

9 years ago

2.1.5

9 years ago

2.1.3

10 years ago

2.1.2

10 years ago