nconf-lite/lib/nconf/stores.js

22 lines
480 B
JavaScript
Raw Normal View History

/*
* stores.js: Top-level include for all nconf stores
*
* (C) 2011, Charlie Robbins
*
*/
var fs = require('fs'),
common = require('./common'),
stores = exports;
//
// Setup all stores as lazy-loaded getters.
//
fs.readdirSync(__dirname + '/stores').forEach(function (file) {
var store = file.replace('.js', ''),
name = common.capitalize(store);
stores.__defineGetter__(name, function () {
return require('./stores/' + store)[name];
});
});