You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,7 @@ This module provides source map support for stack traces in node via the [V8 sta
11
11
$ npm install source-map-support
12
12
```
13
13
14
-
Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, insert the following line at the top of your compiled code:
15
-
16
-
```js
17
-
require('source-map-support').install();
18
-
```
19
-
20
-
And place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler):
14
+
Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler):
21
15
22
16
```
23
17
//# sourceMappingURL=path/to/source.map
@@ -27,6 +21,22 @@ If multiple sourceMappingURL comments exist in one file, the last sourceMappingU
27
21
respected (e.g. if a file mentions the comment in code, or went through multiple transpilers).
28
22
The path should either be absolute or relative to the compiled file.
29
23
24
+
From here you have two options.
25
+
26
+
##### CLI Usage
27
+
28
+
```bash
29
+
node -r source-map-support/register compiled.js
30
+
```
31
+
32
+
##### Programmatic Usage
33
+
34
+
Put the following line at the top of the compiled file.
35
+
36
+
```js
37
+
require('source-map-support').install();
38
+
```
39
+
30
40
It is also possible to install the source map support directly by
31
41
requiring the `register` module which can be handy with ES6:
0 commit comments