nconf-lite/lib/nconf.js

37 lines
792 B
JavaScript
Raw Normal View History

/*
* nconf.js: Top-level include for the nconf module
*
* (C) 2011, Charlie Robbins
*
*/
var Provider = require('./nconf/provider').Provider,
nconf = module.exports = Object.create(Provider.prototype);
2011-04-19 21:34:42 +00:00
//
2011-04-20 05:58:46 +00:00
// ### Version 0.1.7 :: 4/20/2011
2011-04-19 21:34:42 +00:00
//
2011-04-20 05:58:46 +00:00
nconf.version = [0, 1, 7];
2011-04-19 21:34:42 +00:00
//
// ### function path (key)
// #### @key {string} The ':' delimited key to split
// Returns a fully-qualified path to a nested nconf key.
//
nconf.path = function (key) {
return key.split(':');
};
//
// ### function key (arguments)
// Returns a `:` joined string from the `arguments`.
//
nconf.key = function () {
return Array.prototype.slice.call(arguments).join(':');
};
//
// Expose the various components included with nconf
//
nconf.stores = require('./nconf/stores');
nconf.Provider = Provider;