@eddieajau/config-factory
v0.1.4
Published
A simple wrapper for nconf.
Maintainers
Readme
Node.js Config Factory
A simple wrapper for nconf providing the ability to load configuration files in a directory.
Installation
$ npm install @eddieajau/config-factoryExample
ConfigFactory is a static factory class that can be used to create a standard nconf object. However, there are two parameters that can be passed to the createConfig function.
directory- The directory that contains.jsor.jsonconfiguration files to load.overrides- An optional path to a file that can override the properties merged from configuration directory.
var ConfigFactory = require('@eddieajau/config-factory');
var config = ConfigFactory.createConfig({
directory: __dirname + '/etc/',
overrides: __dirname + '/etc/locals.js'
});
var setting = config.get('setting');Configuration files can be either valid .js or .json. After loading, the normal nconf API can be applied.
Code quality and tests
$ npm run lint
$ npm run testLicense
MIT
References
- http://keepachangelog.com
