Skip to content

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

Open
mhamann wants to merge 1 commit into
v0.xfrom
395-yargs-with-options
Open

feat(argv): handle nconf options w/ external yargs#403
mhamann wants to merge 1 commit into
v0.xfrom
395-yargs-with-options

Conversation

@mhamann
Copy link
Copy Markdown
Collaborator

@mhamann mhamann commented Apr 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant