| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4272,6 +4272,29 @@ documentation for the [`'warning'` event][process_warning] and the | |||
| 4272 | 4272 | [`emitWarning()` method][process_emit_warning] for more information about this | |
| 4273 | 4273 | flag's behavior. | |
| 4274 | 4274 | ||
| 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 | + | ||
| 4275 | 4298 | ## `process.umask()` | |
| 4276 | 4299 | ||
| 4277 | 4300 | <!-- YAML | |
| Back | FazBrowse Home | New Git URL |
0 commit comments