Skip to content

Commit 4646a30

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 cc1ff6c commit 4646a30

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
@@ -4314,6 +4314,29 @@ documentation for the [`'warning'` event][process_warning] and the
43144314
[`emitWarning()` method][process_emit_warning] for more information about this
43154315
flag's behavior.
43164316
4317+
## `process.traceProcessWarnings`
4318+
4319+
<!-- YAML
4320+
added: v6.10.0
4321+
-->
4322+
4323+
* {boolean}
4324+
4325+
The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag
4326+
is set on the current Node.js process. This property allows programmatic control over the
4327+
tracing of warnings, enabling or disabling stack traces for warnings at runtime.
4328+
4329+
```js
4330+
// Enable trace warnings
4331+
process.traceProcessWarnings = true;
4332+
4333+
// Emit a warning with a stack trace
4334+
process.emitWarning('Warning with stack trace');
4335+
4336+
// Disable trace warnings
4337+
process.traceProcessWarnings = false;
4338+
```
4339+
43174340
## `process.umask()`
43184341
43194342
<!-- YAML

0 commit comments

Comments
 (0)