1.2.0 • Published 11 years ago
konfu v1.2.0
konfu
config from files, env vars, args
installation
npm install konfuusage
note that as of v1.2.0, the environment variable KONFU must be truthy
for environment variables to override config from files.
var config = require('konfu')
database.connect(config.database_url)where to put stuff
configuration is read, in order, from:
config.jsonand.jsconfig.[NODE_ENV].jsonand.jswhere[NODE_ENV]isprocess.env NODE_ENV. IfNODE_ENVis not set, it defaults todevconfig.travis.json, ifprocess.env.TRAVISprocess.env(lowercased, so that if youexport DB_URL="something",konfu.db_urlis set)process.argv, parsed with optimist
process.env and process.argv are only used to overwrite values already set from a .js or .json file
license
MIT