Skip to content

Commit b328581

Browse files
authored
doc: deprecate coercion to integer in process.exit
This warns of invalid uses of process.exit([code]) and recommends the correct practice. Signed-off-by: Daeyeon Jeong [email protected] PR-URL: #43738 Refs: #43716 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 1643b9e commit b328581

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,6 +3163,20 @@ Use [`diagnostics_channel.subscribe(name, onMessage)`][] or
31633163
[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same
31643164
thing instead.
31653165

3166+
### DEP0164: `process.exit([code])` coercion to integer
3167+
3168+
<!-- YAML
3169+
changes:
3170+
- version: REPLACEME
3171+
pr-url: https://github.com/nodejs/node/pull/43738
3172+
description: Documentation-only deprecation.
3173+
-->
3174+
3175+
Type: Documentation-only
3176+
3177+
`code` values other than `undefined`, `null`, integer numbers and integer
3178+
strings (e.g., '1') are deprecated as parameter in [`process.exit()`][].
3179+
31663180
[Legacy URL API]: url.md#legacy-url-api
31673181
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
31683182
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -3241,6 +3255,7 @@ thing instead.
32413255
[`os.networkInterfaces()`]: os.md#osnetworkinterfaces
32423256
[`os.tmpdir()`]: os.md#ostmpdir
32433257
[`process.env`]: process.md#processenv
3258+
[`process.exit()`]: process.md#processexitcode
32443259
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
32453260
[`process.mainModule`]: process.md#processmainmodule
32463261
[`punycode`]: punycode.md

0 commit comments

Comments
 (0)