From cfe30aebe1b21b1490c35bef2842ccf02032d3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Sun, 8 Sep 2019 13:49:25 -0500 Subject: [PATCH] doc: add code example to inspector.url() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/29496 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Michaƫl Zasso --- doc/api/inspector.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 7cad01c0410722..fb1e362bc25a1c 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -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()`