How to use the nconf.load function in nconf

To help you get started, we’ve selected a few nconf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github empierre / MyDomoAtHome / mdah.js View on Github external
function loadConf() {
    try {
        nconf.load(function (err) {
            if (err) {
                logger.warn("Conf load error:" + err.message);
                return;
            }
        });
    } catch (err) {
        // This will not catch the throw!
        logger.error("Global conf load issue !");
        logger.error(err);
        return;
    }
}
function getConf(){
github Hypercubed / autocmdr / lib / config.js View on Github external
if (key && value !== null) {
      if (value === '') {
        program.log.debug('Clearing key', key);
        nconf.clear(key);
      } else {
        program.log.debug('Setting key', key, 'to', value);
        nconf.set(key, value);
      }
      nconf.save();
      console.log(nconf.save());
    } else if (key) {
      program.log.debug('Retrieving key', key);
      console.log(nconf.get(key));
    } else {
      program.log.debug('Listing all kay-values');
      console.log(nconf.load());
    }
  }
github PolarisChen / Piece / app / config.js View on Github external
function readConfig(settingKey) {
    nconf.load()
    return nconf.get(settingKey)
}

nconf

Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.

MIT
Latest version published 6 months ago

Package Health Score

82 / 100
Full package analysis