Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorlegendecas <legendecas@gmail.com>2021-06-19 10:32:31 +0300
committerMichaƫl Zasso <targos@protonmail.com>2021-09-04 16:14:27 +0300
commit1a6bf1c4a3151112fbea79297d2385242a45a9fa (patch)
treeb52d9ffb3df529335993f3fa55ff7ec409cd877b /doc
parentbaaa397e39beae42800304f6e1229257c3ff4285 (diff)
process: add api to enable source-maps programmatically
Add `process.setSourceMapsEnabled` to enable source-maps programmatically. PR-URL: https://github.com/nodejs/node/pull/39085 Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/process.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/api/process.md b/doc/api/process.md
index 20eea01d6b9..f0f72fc07a7 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -2348,6 +2348,24 @@ This function is only available on POSIX platforms (i.e. not Windows or
Android).
This feature is not available in [`Worker`][] threads.
+## `process.setSourceMapsEnabled(val)`
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental
+
+* `val` {boolean}
+
+This function enables or disables the [Source Map v3][Source Map] support for
+stack traces.
+
+It provides same features as launching Node.js process with commandline options
+`--enable-source-maps`.
+
+Only source maps in JavaScript files that are loaded after source maps has been
+enabled will be parsed and loaded.
+
## `process.setUncaughtExceptionCaptureCallback(fn)`
<!-- YAML
added: v9.3.0
@@ -2732,6 +2750,7 @@ cases:
[LTS]: https://github.com/nodejs/Release
[Readable]: stream.md#stream_readable_streams
[Signal Events]: #process_signal_events
+[Source Map]: https://sourcemaps.info/spec.html
[Stream compatibility]: stream.md#stream_compatibility_with_older_node_js_versions
[TTY]: tty.md#tty_tty
[Writable]: stream.md#stream_writable_streams