How to Debug Node.js Application using VS Code

How to Debug Node.js Application using VS Code

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.

Debugging is one of the most critical aspects of software development. As you probably know, JavaScript programmers really do have their task cut out for them due to the nature of this language. But at the same time, it’s not something that can’t be made much easier with some good tools. 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.

One of the main tasks of the programmer is finding and correcting errors in their code. This is called debugging. The more you code, the more likely it is that you’re going to have some debugging to do. It’s only natural and not a cause for share or concern. After all:

“It’s only those who do nothing that make no mistakes” — Nikola Tesla

Debugging is all about finding the cause of the error quickly and eliminating it. Unfortunately, in the world of JavaScript, this activity is almost inseparably tied to the function console.log().

Image for post

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. As Node.js is getting more and more new features and finds new uses, the issue of Node.js debugging will become even bigger.

And VS Code has plenty of tools to debug Node, including VS Code code debugger, launch configuration options, the ability to set breakpoints, support for external terminal as well as integrated terminal, VS Code Node inspect tools. VS Code can really make or break your application running Node in terms of debugging. If you are as much of VS Code fan as I am, you will definitely appreciate this!

javascript nodejs

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Decoding Nodejs

The main goal of this blog is to explain the “Architecture of Nodejs” and to know how the Nodejs works behind the scenes. Generally, most of the server-side languages, like PHP, ASP.NET, Ruby, and including Nodejs follows multi-threaded architecture. That means for each client-side request initiates a new thread or even a new process.

Hire NodeJs Developer

Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...

JavaScript Shopping Cart - Javascript Project for Beginners

JavaScript Shopping Cart - javascript shopping cart tutorial for beginnersBuy me a coffee 🍺 https://www.paypal.com/paypalme/ziddahSource Code: https://bit....

The essential JavaScript concepts that you should understand

The essential JavaScript concepts that you should understand - For successful developing and to pass a work interview

What is ECMAScript and How is it Different From JavaScript?

Many times developers use JavaScript and ECMAScript synonymously for each other. Though they are very closely linked to each other, it does not mean they are the same thing.here is a complete story on the history of JavaScript and how it came into existence. To cut the long story short, ECMA in ECMAScript refers to Europen Computer Manufacturers Association to which JavaScript 1.1 was submitted for standardization back in the year 1997.