Node Inspector loads and parses files during a debug session and automatically adds them to the GUI. This is useful for
–debug-brk and stepping through
Setting a breakpointTo set a breakpoint in application code:
- Click on the "Show navigator" icon in the upper-left corner of the Node Inspector window to see a tree-list of all source files:
- Click on the desired line number to set a breakpoint there.
Node Inspector highlights the line number in blue.
Breakpoints and uncaught exceptions
Node Inspector restores breakpoints after you restart an application and remembers your breakpoints in the browser's local storage (HTML5). When you restart the debugger process, or start debugging the same application after several days, Node Inspector restores the breakpoints.
You can also break on uncaught exceptions. Node Inspector also provides integration with domains: exceptions handled by domain’s error handler are still considered uncaught. This feature requires Node.js v0.11.3 or greater.
Setting breakpoints in files not yet loaded
Node Inspector enables you to set breakpoints in files that are not yet loaded into the V8 runtime.
To do this, for example for Mocha unit tests:
- Run mocha unit-test in any project with the
- Launch Node Inspector.
- Look at source files of your unit tests and set breakpoints inside them.
- Resume execution when you have all breakpoints set up
- Wait for debugger to hit your first breakpoint.
Display and edit variables
Hover a variable to display and edit its value, as illustrated below:
Support for source maps
Re-execute functions with "Restart Frame"
Right-click on a call frame (stack frame) in the right sidebar and select the ”Restart frame” command to re-execute the current function from the beginning.