Skip to content

docs: document opening the inspector at runtime with node:inspector#3375

Merged
bartlomieju merged 1 commit into
mainfrom
docs/inspector-runtime
Jun 30, 2026
Merged

docs: document opening the inspector at runtime with node:inspector#3375
bartlomieju merged 1 commit into
mainfrom
docs/inspector-runtime

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

The debugging guide only covered the --inspect flag family, so there
was no mention of opening the inspector from inside a running program.
Two feedback issues asked for exactly this, and one was additionally
confused by the node:inspector API reference describing the module as
mostly non-functional stubs.

Adds an "Activating the inspector at runtime" section to the debugging
page documenting node:inspector: inspector.open([port][, host][, wait]) to start the inspector server on demand (default 127.0.0.1:9229,
needs --allow-net), plus inspector.url(), inspector.close(),
inspector.waitForDebugger(), and a note about Session for issuing
Chrome DevTools Protocol commands directly. Includes a server example
that opens the inspector when a /debug request comes in, and a security
caution about binding to a public IP.

node:inspector is in fact functional in Deno (open, close, url,
waitForDebugger, Session, Network, console), so spelling this out
on the debugging page also addresses the "does inspector.open function?"
confusion. I verified the behavior, defaults, and the net-permission
check against the implementation in ext/node/ops/inspector.rs and
ext/node/polyfills/inspector.js.

Closes #3371.
Closes #3372.

Add a section to the debugging page covering inspector.open() / url() /
close() / waitForDebugger() from node:inspector, with a server example
and the --allow-net requirement. node:inspector is functional, not a
stub, so this also clears up the confusion in the feedback issues.

Closes #3371. Closes #3372.
@bartlomieju
bartlomieju merged commit e2e67ea into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback: /api/node/inspector/ - Needs Improvement Feedback: /runtime/fundamentals/debugging/ - Needs Improvement

1 participant