File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3827,6 +3827,29 @@ documentation for the [`'warning'` event][process_warning] and the
3827
3827
[` emitWarning ()` method][process_emit_warning] for more information about this
3828
3828
flag's behavior.
3829
3829
3830
+ ## ` process .traceProcessWarnings `
3831
+
3832
+ <!-- YAML
3833
+ added: v6.10.0
3834
+ -->
3835
+
3836
+ * {boolean}
3837
+
3838
+ The ` process .traceProcessWarnings ` property indicates whether the ` -- trace- warnings` flag
3839
+ is set on the current Node.js process. This property allows programmatic control over the
3840
+ tracing of warnings, enabling or disabling stack traces for warnings at runtime.
3841
+
3842
+ ` ` ` js
3843
+ // Enable trace warnings
3844
+ process .traceProcessWarnings = true ;
3845
+
3846
+ // Emit a warning with a stack trace
3847
+ process .emitWarning (' Warning with stack trace' );
3848
+
3849
+ // Disable trace warnings
3850
+ process .traceProcessWarnings = false ;
3851
+ ` ` `
3852
+
3830
3853
## ` process .umask ()`
3831
3854
3832
3855
<!-- YAML
You can’t perform that action at this time.
0 commit comments