var config = require('{%= name %}');
var base = require('base');
var app = base();
// register the plugin
app.use(config());
The following methods are mapped by default, but any of them can be overridden using app.config.map()
:
.cwd
.data
.define
.del
.disable
.disabled
.enable
.enabled
.get
.has
.option
.set
.store
.use
Map properties on a configuration object to methods on
app
.
Each key on the given object should match the name of a method on app
.
// call `config` as a function
app.config({
set: function(val) {
app.set(val);
}
});
// or use the `map` method
app.config
.map('set')
.map('get')
.map('has');
Iterate over each property on the given object or array of objects, and call the mapped method that matches property key.
//=> calls `app.set('foo', 'bar');
app.config.process({set: {foo: 'bar'}}, function(err) {
if (err) throw err;
});
{%= apidocs("index.js") %}