node.jshelp
命令输出以下内容:
debug> help
Commands: run (r), cont (c), next (n), step (s), out (o), backtrace (bt), setBreakpoint (sb), clearBreakpoint (cb),
watch, unwatch, watchers, repl, restart, kill, list, scripts, breakOnException, breakpoints, version
我可以使用以下命令添加新断点setBreakpoint
:
debug> setBreakpoint(12)
...
但是我可以让它有条件吗?例如:
*only if `foo() === true`, stop here*
另一种方法是像if
在脚本中一样添加它:
if (foo()) { debugger; }
这可以通过 NodeJS 调试器实现吗?