Skip to content

Commit 280d34a

Browse files
authored
Merge pull request #226 from josecolella/patch-1
Update README.md
2 parents 595d533 + 6fc8afc commit 280d34a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,30 @@ Error: this is a demo
209209
at startup (node.js:119:16)
210210
at node.js:901:3
211211
```
212-
212+
213+
There is also the option to use `-r source-map-support/register` with typescript, without the need add the `require('source-map-support').install()` in the code base:
214+
215+
```
216+
$ npm install source-map-support typescript
217+
$ node_modules/typescript/bin/tsc -sourcemap demo.ts
218+
$ node -r source-map-support/register demo.js
219+
220+
demo.ts:5
221+
bar() { throw new Error('this is a demo'); }
222+
^
223+
Error: this is a demo
224+
at Foo.bar (demo.ts:5:17)
225+
at new Foo (demo.ts:4:24)
226+
at Object.<anonymous> (demo.ts:7:1)
227+
at Module._compile (module.js:456:26)
228+
at Object.Module._extensions..js (module.js:474:10)
229+
at Module.load (module.js:356:32)
230+
at Function.Module._load (module.js:312:12)
231+
at Function.Module.runMain (module.js:497:10)
232+
at startup (node.js:119:16)
233+
at node.js:901:3
234+
```
235+
213236
#### CoffeeScript Demo
214237

215238
demo.coffee:

0 commit comments

Comments
 (0)