adding a Usage section to make it clearer how to use this support and how to create sourcemaps yourself
This commit is contained in:
parent
51db253332
commit
52040fe4e3
15
README.md
15
README.md
@ -8,7 +8,18 @@ This module provides source map support for stack traces in node via the [V8 sta
|
|||||||
|
|
||||||
This module takes effect globally and should be initialized by inserting `require('source-map-support').install()` at the top of your code.
|
This module takes effect globally and should be initialized by inserting `require('source-map-support').install()` at the top of your code.
|
||||||
|
|
||||||
### CoffeeScript Demo
|
### Usage
|
||||||
|
|
||||||
|
To use a valid source map (generated using something like [source-map-index-generator][https://github.com/twolfson/source-map-index-generator]),
|
||||||
|
the compiled code should contain the following two extra lines:
|
||||||
|
|
||||||
|
//@sourceMappingURL=path/to/sourceMapFile.json
|
||||||
|
require('source-map-support').install();
|
||||||
|
|
||||||
|
|
||||||
|
### Demos
|
||||||
|
|
||||||
|
#### CoffeeScript Demo
|
||||||
|
|
||||||
The following terminal commands show a stack trace in node with CoffeeScript filenames:
|
The following terminal commands show a stack trace in node with CoffeeScript filenames:
|
||||||
|
|
||||||
@ -39,7 +50,7 @@ The following terminal commands show a stack trace in node with CoffeeScript fil
|
|||||||
at Module.runMain (module.js:492:10)
|
at Module.runMain (module.js:492:10)
|
||||||
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
|
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
|
||||||
|
|
||||||
### TypeScript Demo
|
#### TypeScript Demo
|
||||||
|
|
||||||
The following terminal commands show a stack trace in node with TypeScript filenames:
|
The following terminal commands show a stack trace in node with TypeScript filenames:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user