nconf icon indicating copy to clipboard operation
nconf copied to clipboard

feat(argv): handle nconf options w/ external yargs

Open mhamann opened this issue 3 years ago • 0 comments

Enables the nconf argv loader to receive a second argument of options (e.g., parseValues, transform, etc) when passing in a custom or pre-configured yargs instance.

Example:

let yargs = require('yargs')
    .version('1.2.3')
    .help(false)
    .usage('My usage definition')
    .strict()
    .options({
      "x": {
        alias: 'example',
        describe: 'Example description for usage generation',
        demand: true,
        default: 'some-value'
      }
    });

  nconf.argv(yargs, {
    parseValues: true
  });

Resolves #395.

mhamann avatar Apr 15 '22 04:04 mhamann