Skip to content

Commit

Permalink
[fix] Remove usage of fs.readdirSync in attempt to fix indexzero#130.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero authored and Paul Tyng committed Jul 27, 2016
1 parent 011be49 commit 89638d6
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;

Expand All @@ -23,9 +22,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 89638d6

Please sign in to comment.