Skip to content

Commit

Permalink
[fix] Remove usage of fs.readdirSync in attempt to fix #130.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Jan 6, 2015
1 parent dc6aed2 commit d501e7b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/nconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
*
*/

var fs = require('fs'),
async = require('async'),
var async = require('async'),
common = require('./nconf/common'),
Provider = require('./nconf/provider').Provider,
nconf = module.exports = new Provider();
Expand All @@ -19,9 +18,8 @@ nconf.version = require('../package.json').version;
//
// Setup all stores as lazy-loaded getters.
//
fs.readdirSync(__dirname + '/nconf/stores').forEach(function (file) {
var store = file.replace('.js', ''),
name = common.capitalize(store);
['argv', 'env', 'file', 'literal', 'memory'].forEach(function (store) {
var name = common.capitalize(store);

nconf.__defineGetter__(name, function () {
return require('./nconf/stores/' + store)[name];
Expand Down

0 comments on commit d501e7b

Please sign in to comment.