From 302a134b8378de4ef730a17cfa34caa8d218a560 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Fri, 15 Jul 2022 19:11:54 +0900 Subject: [PATCH] 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 daeyeon.dev@gmail.com PR-URL: https://github.com/nodejs/node/pull/43738 Refs: https://github.com/nodejs/node/pull/43716 Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen Reviewed-By: Ruben Bridgewater --- doc/api/deprecations.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ea747ea1d4feb1..2d0ba9feb4c236 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -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 + + + +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 @@ -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