2011-03-31 06:32:47 +00:00
|
|
|
/*
|
|
|
|
* stores.js: Top-level include for all nconf stores
|
|
|
|
*
|
|
|
|
* (C) 2011, Charlie Robbins
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-05-14 05:47:26 +00:00
|
|
|
var fs = require('fs'),
|
2011-09-16 10:49:47 +00:00
|
|
|
common = require('./common'),
|
2011-05-14 05:47:26 +00:00
|
|
|
stores = exports;
|
2011-03-31 06:32:47 +00:00
|
|
|
|
2011-05-14 05:47:26 +00:00
|
|
|
//
|
|
|
|
// Setup all stores as lazy-loaded getters.
|
|
|
|
//
|
|
|
|
fs.readdirSync(__dirname + '/stores').forEach(function (file) {
|
|
|
|
var store = file.replace('.js', ''),
|
2011-09-16 10:49:47 +00:00
|
|
|
name = common.capitalize(store);
|
2011-05-14 05:47:26 +00:00
|
|
|
|
|
|
|
stores.__defineGetter__(name, function () {
|
|
|
|
return require('./stores/' + store)[name];
|
|
|
|
});
|
2011-09-16 10:49:47 +00:00
|
|
|
});
|