Indicate that keys should be parsed as an array: { array: ['foo', 'bar'] }
.
Indicate that keys should be parsed as an array and coerced to booleans / numbers:
{ array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.
Arguments should be parsed as booleans: { boolean: ['x', 'y'] }
.
Provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error), e.g.
{ coerce: { foo: function (arg) { return modifiedArg } } }
.
Indicate a key that represents a path to a configuration file (this file will be loaded and parsed).
Provide configuration options to the yargs-parser.
Indicate a key that should be used as a counter, e.g., -vvv = {v: 3}
.
Provide default values for keys: { default: { x: 33, y: 'hello world!' } }
.
Environment variables (process.env
) with the prefix provided should be parsed.
Specify that a key requires n arguments: { narg: {x: 2} }
.
path.normalize()
will be applied to values set to this key.
Keys should be treated as numbers.
Keys should be treated as strings (even if they resemble a number -x 33
).
An object representing the set of aliases for a key:
{ alias: { foo: ['f']} }
.