diff options
author | Manuel Spigolon <behemoth89@gmail.com> | 2022-10-07 17:11:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 17:11:32 +0300 |
commit | 880068305f3b76a9e744ccac3cb2b1f4594b13d2 (patch) | |
tree | 509f5d82262b73b97956680c5f02aba439a7bb23 /doc/api | |
parent | 2c57b94920eba77f2796184ce20b6e9b037d7459 (diff) |
util: add default value option to parsearg
Users can set a default
value for every expected
input argument
PR-URL: https://github.com/nodejs/node/pull/44631
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/util.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index 48b32712cf8..3e0505fd525 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1031,6 +1031,9 @@ added: - v18.3.0 - v16.17.0 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/44631 + description: Add support for default values in input `config`. - version: - v18.7.0 - v16.17.0 @@ -1053,6 +1056,9 @@ changes: times. If `true`, all values will be collected in an array. If `false`, values for the option are last-wins. **Default:** `false`. * `short` {string} A single character alias for the option. + * `default` {string | boolean | string\[] | boolean\[]} The default option + value when it is not set by args. It must be of the same type as the + the `type` property. When `multiple` is `true`, it must be an array. * `strict` {boolean} Should an error be thrown when unknown arguments are encountered, or when arguments are passed that do not match the `type` configured in `options`. |