| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4353,6 +4353,29 @@ documentation for the [`'warning'` event][process_warning] and the | |||
| 4353 | 4353 | [`emitWarning()` method][process_emit_warning] for more information about this | |
| 4354 | 4354 | flag's behavior. | |
| 4355 | 4355 | ||
| 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 | + | ||
| 4356 | 4379 | ## `process.umask()` | |
| 4357 | 4380 | ||
| 4358 | 4381 | <!-- YAML | |
| Back | FazBrowse Home | New Git URL |
0 commit comments