From e1604a08fc9e17d83fbaee990300f4a5a66effe5 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 1/5] doc: add code example to inspector.url() method --- doc/api/inspector.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/inspector.md b/doc/api/inspector.md index f82c53f5bc3f51..cdba34954c88ea 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. +```js +// Node process was called with --inspect flag +require('inspector').url() +'ws://127.0.0.1:9229/whatever' + +// Node process was called with --inspect=localhost:3000 flag +require('inspector').url() +'ws://localhost:3000/whatever' +// ---^ host ---^ port + +// Node process was called without --inspect flag +require('inspector').url() +undefined +``` + ## inspector.waitForDebugger()