• One Tip a Week
  • Posts
  • One Tip a Week: VS Code's JavaScript Debug Terminal

One Tip a Week: VS Code's JavaScript Debug Terminal

This week’s tip of the week is the JavaScript debug terminal in VS Code. I thought a lot of people were aware of this, but I still wow people when I show the JavaScript debug terminal, so it’s making an appearance in the newsletter.

VS Code has an integrated terminal. You can open it and use it like you would an external terminal. One cool thing though in VS Code is you can choose different terminals. One terminal you can select is the JavaScript Debug Terminal.

VS Code Terminal drop down picker

It's a terminal that loads your regular shell, but if you run anything that is Node.js, it will allow you to debug it. This is super powerful and convenient.

You can start an npm script, a Node.js process, anything that starts Node.js and you're able to add breakpoints in VS Code and debug right away.

VS Code running a node.js applicaition with the application paused a breakpoint

I always used to use node --inspect-brk ./some-node-process.js but now that is no longer required in a lot of cases.

If you'd like to learn more about the JavaScript debug terminal, check out the official docs for the debug terminal.

That’s it! Short and sweet. Until the next one!