config4u
v0.1.1
Published
Environment, command line or JSON file with comments and single quotes
Readme
config4u
Environment, command line or JSON file with comments and single quotes
Wanted multiple tiered config like config https://github.com/lorenwest/node-config will use NODE_ENV and ALCE parsing like getconfig with the added ability to define config.json directory or filename via command line --config or environment variable NODE_CONFIG_DIR
Install :hammer:
npm install config4uUsage :bulb:
{
postgres: {
"url": '...', // database connection url
}
}config = new require('config4u')({ default: "values"})
dburl = config.postgres.urlnode myapp.js --config dir_or_filename // /somepath for /somepath.config.json or dev_config.json for /current_dir/dev_config.jsonAssignment order
- Passed in defaults
config.jsonfile (in current application directory if not defined by--config)config.jsonfile (as defined by--config)config.jsonfile (optionally if defined byNODE_CONFIG_DIR)NODE_ENVenvironment value as JSON string, ex:NODE_ENV = "{postgres: {url: '...'}}"
Contributions :muscle:
:smile: Feedback, problem reports, enhancement requests are welcome.
:up: Example code are better.
:cool: Pull requests are best.
