lib: add api to detect whether source-maps are enabled

Add `process.sourceMapsEnabled` to detect
whether source-maps are enabled.

Fixes: https://github.com/nodejs/node/issues/46304
PR-URL: https://github.com/nodejs/node/pull/46391
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit is contained in:
翠 / green
2023-08-17 17:42:12 +09:00
committed by GitHub
parent b4a2be457c
commit 6bb400f8ec
4 changed files with 30 additions and 0 deletions

View File

@@ -3517,6 +3517,19 @@ throw an error.
Using this function is mutually exclusive with using the deprecated
[`domain`][] built-in module.
## `process.sourceMapsEnabled`
<!-- YAML
added: REPLACEME
-->
> Stability: 1 - Experimental
* {boolean}
The `process.sourceMapsEnabled` property returns whether the
[Source Map v3][Source Map] support for stack traces is enabled.
## `process.stderr`
* {Stream}