From 58f3596f7622944c5e91675630f3bc71a9e838f8 Mon Sep 17 00:00:00 2001 From: tomass22 Date: Sun, 9 Aug 2026 10:39:32 +0000 Subject: [PATCH] doc: document --trace-promises `--trace-promises` has been available since v21.5.0 but was never added to the CLI documentation. Instead it was added to the list of intentionally undocumented options in test/parallel/test-process-env-allowed-flags-are-documented.js. Unlike the other entries in that list, which are either legacy no-ops or internal-only debugging switches, `--trace-promises` is a user-facing diagnostic flag that is allowed in NODE_OPTIONS, and its siblings `--trace-env`, `--trace-uncaught` and `--trace-warnings` are all documented. Document it in doc/api/cli.md, regenerate doc/node.1 accordingly, and drop the two exemptions from the test. Assisted-by: Claude Opus 5 (1M context) Signed-off-by: tomass22 --- doc/api/cli.md | 14 ++++++++++++++ doc/node.1 | 8 ++++++++ ...est-process-env-allowed-flags-are-documented.js | 2 -- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 2052f010f4b..563e97fcef3 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3323,6 +3323,19 @@ added: Prints a stack trace whenever an environment is exited proactively, i.e. invoking `process.exit()`. +### `--trace-promises` + + + +Prints a stack trace to stderr whenever a promise is created or resolved. Each +promise is given an identifier, and the identifier of the parent promise is +also printed when the promise is derived from another one. Promise `before` and +`after` hook events are not traced, to reduce the amount of output. + ### `--trace-require-module=mode`