Skip to content

debugger: add --help to node inspect and improve docs#63201

Open
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:probe-doc
Open

debugger: add --help to node inspect and improve docs#63201
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:probe-doc

Conversation

@joyeecheung
Copy link
Copy Markdown
Member

@joyeecheung joyeecheung commented May 8, 2026

  • Add --help / -h to node inspect covering both interactive and non-interactive probe modes. The help text is printed when --help/-h appears before any positional argument to avoid hijacking --help passed to a child script.
  • Improve the documentation of probe mode and add examples, explain same-location probe coalescing, TDZ caveat for let/const bindings, basename matching and exit code behavior. Also move it to a section parallel to interactive mode. Remove recommendation of evaluating structured expressions as that is prone to missing info in JSON mode.

Drive-by: when probe mode exits due to invalid arguments, exit with kInvalidCommandLineArgument (9) instead of kGenericUserError (1).

@nodejs-github-bot nodejs-github-bot added debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run. labels May 8, 2026
@joyeecheung joyeecheung requested review from hybrist and legendecas May 8, 2026 15:15
- Add `--help` / `-h` to `node inspect` covering both interactive and
  non-interactive probe modes. The help text is printed when
  `--help`/`-h` appears before any positional argument to avoid
  hijacking `--help` passed to a child script.
- Improve the documentation of probe mode and add examples, explain
  same-location probe coalescing, TDZ caveat for let/const bindings,
  basename matching and exit code behavior. Also move it to a
  section parallel to interactive mode. Remove recommendation of
  evaluating structured expressions as that is prone to missing
  info in JSON mode.

Drive-by: When probe mode exits due to invalid arguments, exit with
`kInvalidCommandLineArgument` (9) instead of `kGenericUserError` (1).

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Comment thread doc/api/debugger.md
Pressing `enter` without typing a command will repeat the previous debugger
command.

### Watchers
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit weird in the diff, apparently if you move a block and then add one more level of # to the headings, git would recognize it as a new block. The content below are copied verbatim from the original block below probe mode docs (which was misplaced, this should've followed interactive mode docs, hence this PR moved it back).

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 99.25373% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.03%. Comparing base (1fd4949) to head (b62ed5a).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/debugger/inspect_helpers.js 98.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #63201    +/-   ##
========================================
  Coverage   90.03%   90.03%            
========================================
  Files         713      713            
  Lines      224699   224995   +296     
  Branches    42473    42533    +60     
========================================
+ Hits       202310   202580   +270     
- Misses      14179    14186     +7     
- Partials     8210     8229    +19     
Files with missing lines Coverage Δ
lib/internal/debugger/inspect.js 93.97% <100.00%> (+1.30%) ⬆️
lib/internal/debugger/inspect_probe.js 76.34% <100.00%> (-1.50%) ⬇️
lib/internal/debugger/inspect_helpers.js 97.19% <98.33%> (+0.22%) ⬆️

... and 49 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants