Skip to content

Commit 3bb0135

Browse files
doc: add documentation for process.traceProcessWarnings
resolves #53514 PR-URL: #53641 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent d91543a commit 3bb0135

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

0 commit comments

Comments
 (0)