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/api
diff options
context:
space:
mode:
authorlegendecas <legendecas@gmail.com>2021-06-19 10:32:31 +0300
committerlegendecas <legendecas@gmail.com>2021-07-15 14:45:16 +0300
commit82b1b551223f89dd2023d46344fa4a882babebad (patch)
treec32ea396413a63017e8a3e37ab04f009e06ef6ad /doc/api
parent4b0776ab64596d1bbd98a93e3de7cee82a7e8130 (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/api')
-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 b8c9d7b4b7c..2a4d6e83976 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -3249,6 +3249,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
@@ -3670,6 +3688,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