Writing & Debugging NodeJS code in Typescript & VSCode

Sahil Malik
Winsmarts.com
Published in
2 min readJan 7, 2018

--

I ❤ Node JS .. It’s super productive, cross platform, fast .. etc. etc.

I also ❤ VSCode (see my VSCode tips & tricks)

And yes, I ❤ TypeScript too.

What I found frustrating is, the plumbing you need to put together to write NodeJS code in Typescript, and be able to debug it with full sourcemap support right inside VSCode.

So, I wrote a project template for it.

Here is how to use it,

a) Clone it, run yarn/npm install.
b) the code is in the src folder … open the project in VSCode, and set a breakpoint,

.. and hit F5. :-) .. yep that easy!

Basically everything works ..

a) Breakpoints are hit ..

b) Full evaluation works, on Typescript objects,

c) Local variables work,

d) Watch works ..

.. basically everything you expect out of a proper IDE .. works! To stop debugging, hit SHIFT_F5.

Have fun!

--

--