Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/api/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ parameter usage.

Return the URL of the active inspector, or `undefined` if there is none.

```js
// Node process was called with --inspect flag
Comment thread
BridgeAR marked this conversation as resolved.
Outdated
require('inspector').url()
Comment thread
BridgeAR marked this conversation as resolved.
Outdated
'ws://127.0.0.1:9229/whatever'
Comment thread
BridgeAR marked this conversation as resolved.
Outdated

// Node process was called with --inspect=localhost:3000 flag
Comment thread
BridgeAR marked this conversation as resolved.
Outdated
require('inspector').url()
'ws://localhost:3000/whatever'
Comment thread
BridgeAR marked this conversation as resolved.
Outdated
// ---^ host ---^ port
Comment thread
BridgeAR marked this conversation as resolved.
Outdated

// Node process was called without --inspect flag
Comment thread
BridgeAR marked this conversation as resolved.
Outdated
require('inspector').url()
undefined
```

## inspector.waitForDebugger()
<!-- YAML
added: v12.7.0
Expand Down