Visual Studio Code — Debug Mode
It has been about a year since I switched to Visual Studio Code (also known as
VSCode) as my primary text editor and development environment. VS Code is a beautifully crafted text editor and has a convenient debug mode feature.
Before we begin…
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.
- Switch to the debug mode in the editor
- Click on the ⚙️launch configuration
Node.jsas the environment
4. Update the name of the program in
5. Let’s add a breakpoint in our code
6. Start Debugging
For the advanced 🦸♂️,
If you are using Babel to compile your code, let's not forget in
retainLines: true option.
This will let the program pause its execution in the compiled code at the exact line where you put the breakpoint in VS Code.
Visual Studio Code is a completely free and open source text editor. A lot of passion has gone into building this editor by the community and making this performant. VS Code has become an indispensable tool for me. Hope you will enjoy this tool as well. Peace ✌️