As per the [official docs](https://nodejs.org/api/debugger.html): - [x] `node debug <script>` starts the script and attaches a debugger - [x] `node debug <host>:<port>` attaches to a running debugger remotely - [x] `help` shows available commands - [x] Enter repeats the last command #### Stepping - [x] `cont`, `c`: Resumes execution - [x] `next`, `n`: Step over current line - [x] `step`, `s`: Step into current line, potentially entering the function being called - [x] `out`, `o`: Drop out of current function - [x] `pause`: Pause execution #### Breakpoints - [x] `setBreakpoint()`, `sb()`: Set breakpoint on current line - [x] `setBreakpoint(line)`, `sb(line)`: Set breakpoint on specific line - [x] `setBreakpoint('fn()')`, `sb(...)`: Set breakpoint on a first statement in functions body - [x] `setBreakpoint('script.js', 1)`, `sb(...)`: Set breakpoint on first line of script.js - [x] `breakpoints`: List all breakpoints - [ ] `clearBreakpoint('script.js', 1)`, `cb(...)`: Clear breakpoint in script.js on line 1 - [x] It is also possible to set a breakpoint in a file (module) that isn't loaded yet #### Information - [x] `backtrace`, `bt`: Print backtrace of current execution frame - [x] `list(n)`: List scripts source code with `n` line context (`n` lines before and after) - [x] `watch(expr)`: Add expression to watch list - [x] `unwatch(expr)`: Remove expression from watch list - [x] `watchers`: List all watchers and their values (automatically listed on each breakpoint) - [x] `repl`: Open debugger's repl for evaluation in debugging script's context - [x] `exec expr`/`exec('expr')`: Execute an expression in debugging script's context #### Execution control - [x] `run`: Run script (automatically runs on debugger's start) - [x] `restart`: Restart script - [x] `kill`: Kill script #### Various - [x] `scripts`: List all loaded scripts - [x] `version`: Display V8's version
As per the official docs:
node debug <script>starts the script and attaches a debuggernode debug <host>:<port>attaches to a running debugger remotelyhelpshows available commandsStepping
cont,c: Resumes executionnext,n: Step over current linestep,s: Step into current line, potentially entering the function being calledout,o: Drop out of current functionpause: Pause executionBreakpoints
setBreakpoint(),sb(): Set breakpoint on current linesetBreakpoint(line),sb(line): Set breakpoint on specific linesetBreakpoint('fn()'),sb(...): Set breakpoint on a first statement in functions bodysetBreakpoint('script.js', 1),sb(...): Set breakpoint on first line of script.jsbreakpoints: List all breakpointsclearBreakpoint('script.js', 1),cb(...): Clear breakpoint in script.js on line 1Information
backtrace,bt: Print backtrace of current execution framelist(n): List scripts source code withnline context (nlines before and after)watch(expr): Add expression to watch listunwatch(expr): Remove expression from watch listwatchers: List all watchers and their values (automatically listed on each breakpoint)repl: Open debugger's repl for evaluation in debugging script's contextexec expr/exec('expr'): Execute an expression in debugging script's contextExecution control
run: Run script (automatically runs on debugger's start)restart: Restart scriptkill: Kill scriptVarious
scripts: List all loaded scriptsversion: Display V8's version