index.js
function Load (options) {
  var self = this;
  self._path = options.path || './config';
  self._environment = options.environment || args().env || 'development';
  self._reload = options.reload || false;

  // reload the env configuration when the current file is updated
  if (self._reload) {
    var file = self._path + '/' + self._environment + '.json';
    self._watcher = chokidar.watch(file, {ignored: /[\/\\]\./, persistent: true});
    self._watcher.on('change', function () {
      self._watcher.close();
      Load.init.call(self);
    });
  }

  // normal load
  Load.init.call(self);
}
function Load (options) {
  var self = this;
  self._path = options.path || './config';
  self._environment = options.environment || args().env || 'development';
  self._reload = options.reload || false;

  // reload the env configuration when the current file is updated
  if (self._reload) {
    var file = self._path + '/' + self._environment + '.json';
    self._watcher = chokidar.watch(file, {ignored: /[\/\\]\./, persistent: true});
    self._watcher.on('change', function () {
      self._watcher.close();
      Load.init.call(self);
    });
  }

  // normal load
  Load.init.call(self);
}
function Load ( options ) { var self = this ; self . _path = options . path || './config' ; self . _environment = options . environment || args ( ) . env || 'development' ; self . _reload = options . reload || false ; // reload the env configuration when the current file is updated if ( self . _reload ) { var file = self . _path + '/' + self . _environment + '.json' ; self . _watcher = chokidar . watch ( file , { ignored : / [\/\\]\. / , persistent : true } ) ; self . _watcher . on ( 'change' , function ( ) { self . _watcher . close ( ) ; Load . init . call ( self ) ; } ) ; } // normal load Load . init . call ( self ) ; }
(environment, path, reload) {environment: 'environment', path: 'path', reload: true || false}
( environment path reload ) { environment : environment path : path reload : true || false }