GeezerVison is showing github.com — doc: add code example to inspector.url() method · nodejs/node@b1358d3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,21 @@ parameter usage. |
52 | 52 |
|
53 | 53 | Return the URL of the active inspector, or `undefined` if there is none. |
54 | 54 |
|
| 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 | + |
55 | 70 | ## `inspector.waitForDebugger()` |
56 | 71 | <!-- YAML |
57 | 72 | added: v12.7.0 |
|