mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
doc: add code example to inspector.url() method
PR-URL: https://github.com/nodejs/node/pull/29496 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
1 parent
855ca736de
commit
411360150a
1 file changed
+15
@@ -52,6 +52,21 @@ parameter usage.
|
||||
|
||||
Return the URL of the active inspector, or `undefined` if there is none.
|
||||
|
||||
```console
|
||||
$ node --inspect -p 'inspector.url()'
|
||||
Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
|
||||
For help see https://nodejs.org/en/docs/inspector
|
||||
ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
|
||||
|
||||
$ node --inspect=localhost:3000 -p 'inspector.url()'
|
||||
Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
|
||||
For help see https://nodejs.org/en/docs/inspector
|
||||
ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
|
||||
|
||||
$ node -p 'inspector.url()'
|
||||
undefined
|
||||
```
|
||||
|
||||
## inspector.waitForDebugger()
|
||||
<!-- YAML
|
||||
added: v12.7.0
|
||||
|
||||
Reference in new issue
Block a user