Skip to content

Commit 31476cd

Browse files
AlirezaEbrahimkhaniaduh95
authored andcommitted
doc: add documentation for process.traceProcessWarnings
resolves #53514 PR-URL: #53641 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 99c783b commit 31476cd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/api/process.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4353,6 +4353,29 @@ documentation for the [`'warning'` event][process_warning] and the
43534353
[`emitWarning()` method][process_emit_warning] for more information about this
43544354
flag's behavior.
43554355
4356+
## `process.traceProcessWarnings`
4357+
4358+
<!-- YAML
4359+
added: v6.10.0
4360+
-->
4361+
4362+
* {boolean}
4363+
4364+
The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag
4365+
is set on the current Node.js process. This property allows programmatic control over the
4366+
tracing of warnings, enabling or disabling stack traces for warnings at runtime.
4367+
4368+
```js
4369+
// Enable trace warnings
4370+
process.traceProcessWarnings = true;
4371+
4372+
// Emit a warning with a stack trace
4373+
process.emitWarning('Warning with stack trace');
4374+
4375+
// Disable trace warnings
4376+
process.traceProcessWarnings = false;
4377+
```
4378+
43564379
## `process.umask()`
43574380
43584381
<!-- YAML

0 commit comments

Comments
 (0)