Skip to content

Commit

Permalink
doc: deprecate coercion to integer in process.exit
Browse files Browse the repository at this point in the history
This warns of invalid uses of process.exit([code]) and recommends the
correct practice.

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

PR-URL: #43738
Refs: #43716
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
daeyeon authored and targos committed Jul 31, 2022
1 parent 49cbed6 commit 302a134
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3120,6 +3120,20 @@ Use [`diagnostics_channel.subscribe(name, onMessage)`][] or
[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same
thing instead.

### DEP0164: `process.exit([code])` coercion to integer

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/43738
description: Documentation-only deprecation.
-->

Type: Documentation-only

`code` values other than `undefined`, `null`, integer numbers and integer
strings (e.g., '1') are deprecated as parameter in [`process.exit()`][].

[Legacy URL API]: url.md#legacy-url-api
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
Expand Down Expand Up @@ -3198,6 +3212,7 @@ thing instead.
[`os.networkInterfaces()`]: os.md#osnetworkinterfaces
[`os.tmpdir()`]: os.md#ostmpdir
[`process.env`]: process.md#processenv
[`process.exit()`]: process.md#processexitcode
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
[`process.mainModule`]: process.md#processmainmodule
[`punycode`]: punycode.md
Expand Down

0 comments on commit 302a134

Please sign in to comment.