How will you debug an application in Node.js?

 Node.js includes a debugging utility called debugger

To enable it start the Node.js with the debug argument followed by the path to the script to debug.

Syntax:

1
node debug [script.js | -e "script" | <host> : <port> ]

Inserting the statement debugger; into the source code of a script will enable a breakpoint at that position in the code:

Comments

Popular posts from this blog

Which node logger did you use in your project?

What are clusters and worker threads, and when would you use them?