diff options
author | Benjamin E. Coe <bencoe@google.com> | 2022-05-24 20:07:26 +0300 |
---|---|---|
committer | Bryan English <bryan@bryanenglish.com> | 2022-05-30 19:33:54 +0300 |
commit | d6cf409d787dce7f895ac37acee1bcea74d5a808 (patch) | |
tree | 4c15b883fdace5c4580415c206de35d8a29ad112 /doc/api/errors.md | |
parent | baa5d0005ad26c053a17b56a11a0c6912a2c9500 (diff) |
util: add parseArgs module
Adds util.parseArgs helper for higher level command-line argument
parsing.
PR-URL: https://github.com/nodejs/node/pull/42675
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joe Sepi <sepi@joesepi.com>
Reviewed-By: Ian Sutherland <ian@iansutherland.ca>
Diffstat (limited to 'doc/api/errors.md')
-rw-r--r-- | doc/api/errors.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/api/errors.md b/doc/api/errors.md index 5bc949d5b12..4097d21a0b5 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2344,6 +2344,40 @@ The `package.json` [`"exports"`][] field does not export the requested subpath. Because exports are encapsulated, private internal modules that are not exported cannot be imported through the package resolution, unless using an absolute URL. +<a id="ERR_PARSE_ARGS_INVALID_OPTION_VALUE"></a> + +### `ERR_PARSE_ARGS_INVALID_OPTION_VALUE` + +<!-- YAML +added: REPLACEME +--> + +When `strict` set to `true`, thrown by [`util.parseArgs()`][] if a {boolean} +value is provided for an option of type {string}, or if a {string} +value is provided for an option of type {boolean}. + +<a id="ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL"></a> + +### `ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL` + +<!-- YAML +added: REPLACEME +--> + +Thrown by [`util.parseArgs()`][], when a postional argument is provided and +`allowPositionals` is set to `false`. + +<a id="ERR_PARSE_ARGS_UNKNOWN_OPTION"></a> + +### `ERR_PARSE_ARGS_UNKNOWN_OPTION` + +<!-- YAML +added: REPLACEME +--> + +When `strict` set to `true`, thrown by [`util.parseArgs()`][] if an argument +is not configured in `options`. + <a id="ERR_PERFORMANCE_INVALID_TIMESTAMP"></a> ### `ERR_PERFORMANCE_INVALID_TIMESTAMP` @@ -3455,6 +3489,7 @@ The native call from `process.cpuUsage` could not be processed. [`subprocess.send()`]: child_process.md#subprocesssendmessage-sendhandle-options-callback [`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost [`util.getSystemErrorName(error.errno)`]: util.md#utilgetsystemerrornameerr +[`util.parseArgs()`]: util.md#utilparseargsconfig [`zlib`]: zlib.md [crypto digest algorithm]: crypto.md#cryptogethashes [debugger]: debugger.md |