Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: v0.x
Choose a base branch
from

Conversation

mhamann
Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant