
When the VS Code project is launched, you can make sure it works fine by making a request to the newly launched API from the terminal:ģ. Once you get it and enter the project directory, you can start the launch program: It was important for me that the app was divided into a couple of files and modules and so that the API logic was not contained in a single index.js file. Our example application is written in vanilla JavaScript running Node js.
If you are as much of VS Code fan as I am, you will definitely appreciate this! VS Code can really make or break your application running Node in terms of debugging. As Node.js is getting more and more new features and finds new uses, the issue of Node.js debugging will become even bigger.Īnd VS Code has plenty of tools to debug Node, including VS Code code debugger, launch configuration options, the ability to set breakpoints, support for the external terminal as well as integrated terminal, VS Code Node inspect tools. In this article, I’m going to go over the most helpful features of Visual Studio Code(VS Code) that you can use to debug Node, more specifically to debug the code of a simple API written with Node.js based on vanilla JavaScript. It’s worth knowing that our integrated development environment (IDE) of choice is equipped with a variety of tools that can speed up and simplify debugging. Unfortunately, in the world of JavaScript, this activity is almost inseparably tied to the function console.log().

It’s only those who do nothing that make no mistakes – Nikola Teslaĭebugging is all about finding the cause of the error quickly and eliminating it. It’s only natural and not a cause for share or concern. The more you code, the more likely it is that you’re going to have some debugging to do.

One of the main tasks of the programmer is finding and correcting errors in their code. Let’s see how you can debug Node, make some Node.js debugging with VS Code and make your life much easier in the process. But at the same time, it’s not something that can’t be made much easier with some good tools.

As you probably know, JavaScript programmers really do have their task cut out for them due to the nature of this language. Debugging is one of the most critical aspects of software development.
