Debugging and Testing

Console.log:

One of the most common form of debugging is the use of console.log statement. If you are not good at debugging you can use this console.log statement in your application to find low potential errors. It just simply prints on the screen. Nothing is like setting breakpoints or typical debugger stuff. It will console the message on your browser if you write it in the client’s side code. For the server side it will console the message on the editor.

Debugging with Node inspector:

Node inspector is a powerful JavaScript debugger for NodeJS applciations that uses the blink developer tools. It has many advanced features.

To install node inspector type

npm install –g node-inspector

To start debugging type the following command:

node-debug app.js

Here are some articles, do read them:

  1. Debugging and Testing of a Node Application
  2. Top 10 Node.js Debugging Tips to Debug Like a Pro