1, command-line debugging
Run executes the script, pausing on the first line
Restart re-executing the script
Cont, C continues execution until the next breakpoint is encountered
Next, N Single Step execution
Step, s stepping into function
Out, O step out of the function
Setbreakpoint (), SB () set a breakpoint on the current line
Setbreakpoint (' F () '), SB (...) set a breakpoint on the first line of function f
Setbreakpoint (' Script.js '), SB (...) set a breakpoint on line 20th of Script.js
Clearbreakpoint, CB (...) Clear all breakpoints
BackTrace, BT displays the current call stack
List (5) shows the front and back 5 lines of code that are currently executing
Watch (expr) joins expression expr to watch list
Unwatch (expr) to remove expression expr from the watch list
Watchers display all expressions and values in the watch list
REPL Open an immediate evaluation environment in the current context
Kill terminates the currently executing script
Scripts show all scripts that are currently loaded
Version shows the versions of V8
2, TCP debugging
$ node--debug-brk debug.js
Debugger listening on port 5858
$ node Debug 127.0.0.1:5858
Connecting ... ok
Nodejs Debugging Tips