It has been about a year since I switched to Visual Studio Code (also known as Code or VSCode ) as my primary text editor and development environment. VS Code is a beautifully crafted text editor and has a convenient debug mode feature.

I am choosing Javascript as the programming language here to explain how the debug mode works, but this will work over a lot of different programming languages.

Before we begin…

Visual Studio Code

If you are hearing about Visual Studio Code for the first time, this is an editor built at Microsoft which sits between a text editor and a full-blown IDE. It has a high-quality extension ecosystem and a great community around this.

In this article, we will see how to debug a simple Node JS application using Visual Studio Code.

Editor Setup

Switch to the debug mode in the editor Click on the ⚙️launch configuration Select Node.js as the environment

Visual Studio Code — Debug Mode

4. Update the name of the program in launch.json and save.

launch.json

5. Let’s add a breakpoint in our code

Adding a breakpoint in the code

6. Start Debugging