Skip to content

Commit 1cce000

Browse files
juanarbolMylesBorins
authored andcommitted
doc: add code example to inspector.url() method
PR-URL: #29496 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 123327d commit 1cce000

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/inspector.md

+15
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ parameter usage.
5252

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

55+
```console
56+
$ node --inspect -p 'inspector.url()'
57+
Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
58+
For help see https://nodejs.org/en/docs/inspector
59+
ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
60+
61+
$ node --inspect=localhost:3000 -p 'inspector.url()'
62+
Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
63+
For help see https://nodejs.org/en/docs/inspector
64+
ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
65+
66+
$ node -p 'inspector.url()'
67+
undefined
68+
```
69+
5570
## inspector.waitForDebugger()
5671
<!-- YAML
5772
added: v12.7.0

0 commit comments

Comments
 (0)