Monday 3 June 2013

Debugging node.js

ndb  -  Command line debugger.

Eclipse debugger plugin for V8.

Node inspector is a graphical debugging tool for node.js.


To install node inspector module



$ npm install node-inspector -g


To enable debug mode


$ node --debug  your/node/program.js

To pause script on first line

$ node --debug -brk your/short/node/script.js 

To use profiles panel, install v8-profiler module:

$ npm install v8-profiler


start node in debug mode

$ node --debug app.js

node inspector optionally supports the v8 profiler.
it collects cpu and heap snapshots.

--trace-gc  option to watch gc behavior.