Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b1358d3

Browse filesBrowse files
juanarboltargos
authored andcommitted
doc: add code example to inspector.url() method
PR-URL: #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>
1 parent 0638b78 commit b1358d3
Copy full SHA for b1358d3

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/inspector.md‎

Copy file name to clipboardExpand all lines: doc/api/inspector.md
+15Lines changed: 15 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.