node/lib/internal/debugger
Joyee Cheung 141de35399
debugger: add --help to node inspect and improve docs
- 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>
PR-URL: https://github.com/nodejs/node/pull/63201
Reviewed-By: Jan Martin <jan.krems@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-06-18 00:15:51 +02:00
..
inspect.js debugger: add --help to node inspect and improve docs 2026-06-18 00:15:51 +02:00
inspect_client.js debugger: add edit-free runtime expression probes to node inspect 2026-05-07 15:41:42 +02:00
inspect_helpers.js debugger: add --help to node inspect and improve docs 2026-06-18 00:15:51 +02:00
inspect_probe.js debugger: add --help to node inspect and improve docs 2026-06-18 00:15:51 +02:00
inspect_repl.js