enable use with webpack by removing unnecessary fs call ()

This commit is contained in:
evoye 2017-08-16 05:39:34 +02:00 committed by Matt Hamann
parent 608b607782
commit 5e8a34d6cf

View file

@ -5,8 +5,7 @@
*
*/
var fs = require('fs'),
async = require('async'),
var async = require('async'),
common = require('./nconf/common'),
Provider = require('./nconf/provider').Provider;
@ -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];
@ -41,4 +39,3 @@ nconf.loadFiles = common.loadFiles;
nconf.loadFilesSync = common.loadFilesSync;
nconf.formats = require('./nconf/formats');
nconf.Provider = Provider;