cnf

3.3.3 • Public • Published

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)"

Readme

Keywords

Package Sidebar

Install

npm i cnf

Weekly Downloads

418

Version

3.3.3

License

MIT

Unpacked Size

5.09 kB

Total Files

3

Last publish

Collaborators

  • ebdrup
  • bubenshchykov
  • kapetan
  • wtfil
  • eagleeye
  • jonatanpedersen
  • bifrost
  • mpushkin