nconf-lite/lib/nconf.js
2011-05-16 22:44:46 -04:00

42 lines
No EOL
857 B
JavaScript

/*
* 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);
//
// Use the memory engine by default.
//
nconf.use('memory');
//
// ### Version 0.1.9 :: 5/16/2011
//
nconf.version = [0, 1, 9];
//
// ### 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;