cnf
Configuration loader.
npm install -SE cnf
To use it simply require it:
var config = ; console;
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)"