kibbutz-rc
v1.0.0
Published
RC configuration provider for Kibbutz.
Downloads
5
Maintainers
Readme
Kibbutz RC Plugin
RC configuration provider for Kibbutz.
The kibbutz-rc
module is a kibbutz
provider for loading configuration fragments from rc
.
Usage
Add kibbutz-rc
as a dependency in package.json
:
$ npm install kibbutz-rc -S
Create an instance of RcProvider
and supply it to the load()
method of a Kibbutz
instance:
const Kibbutz = require('kibbutz');
const RcProvider = require('kibbutz-rc');
const config = new Kibbutz({
value: {
foo: 'bar'
}
});
const rcProvider = new RcProvider({
appName: 'myapp'
});
config.load([ rcProvider ], function(err, config) {
// do something beautiful with your configuration
});
Constructor Options
The kibbutz-rc
plugin provides options to configure the underlying rc
module. Constructor options should be an object, and can contain the following keys:
appName
: (required) theappName
to pass torc
.defaults
: (optional) an object that contains the default values to pass torc
.argv
: (optional) the componentrc
should use to parse command-like arguments.parser
: (optional) the parserrc
should to interpret configuration data.