Skip to content

Commit 134780c

Browse files
AlirezaEbrahimkhaniRafaelGSS
authored andcommitted
doc: add documentation for process.traceProcessWarnings
resolves #53514 PR-URL: #53641 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 3b08efc commit 134780c

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
@@ -4272,6 +4272,29 @@ documentation for the [`'warning'` event][process_warning] and the
42724272
[`emitWarning()` method][process_emit_warning] for more information about this
42734273
flag's behavior.
42744274
4275+
## `process.traceProcessWarnings`
4276+
4277+
<!-- YAML
4278+
added: v6.10.0
4279+
-->
4280+
4281+
* {boolean}
4282+
4283+
The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag
4284+
is set on the current Node.js process. This property allows programmatic control over the
4285+
tracing of warnings, enabling or disabling stack traces for warnings at runtime.
4286+
4287+
```js
4288+
// Enable trace warnings
4289+
process.traceProcessWarnings = true;
4290+
4291+
// Emit a warning with a stack trace
4292+
process.emitWarning('Warning with stack trace');
4293+
4294+
// Disable trace warnings
4295+
process.traceProcessWarnings = false;
4296+
```
4297+
42754298
## `process.umask()`
42764299
42774300
<!-- YAML

0 commit comments

Comments
 (0)