How to use the argv function from nconf

Find comprehensive JavaScript nconf.argv code examples handpicked from public code repositorys.

17
18
19
20
21
22
23
24
25
26
 * @return {Hash|Boolean} Returns config or false if missing
 * @api public
 */
loadConfig: function( defaultConfig ) {

  return nconf.argv()
          .overrides( defaultConfig )
          .defaults(require('../config.json'))
          .env()
          .file({ file: process.cwd() + '/config.json' });
fork icon0
star icon5
watch icon2

18
19
20
21
22
23
24
25
26
27
env: options => {
  nconf.env(Object.assign({ transform }, options));
  return module.exports;
},
argv: options => {
  nconf.argv(Object.assign({ transform }, options));
  return module.exports;
},
use: (name, options) => {
  let store;
fork icon0
star icon3
watch icon2

30
31
32
33
34
35
36
37
38
39
start () {
  if(this.started){ return Promise.resolve(this) }

  this.touchDir('')
  let file_name = 'config.json'
  nconf.argv()
  const config_file = nconf.get('config')
  if (config_file){
    const file_path = Path.parse(config_file)
    file_name = file_path.base
fork icon0
star icon0
watch icon2

+ 3 other calls in file