Uh oh!
There was an error while loading. Please reload this page.
doc: add code example to inspector.url() method - #29496
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
juanarbol
commented
Sep 24, 2019
ping @Trott |
Trott
commented
Sep 25, 2019
Trott
commented
Sep 25, 2019
@nodejs/documentation How do we feel about this sample code? It's not really a runnable code sample. It's really just "Here's what the output would be with three completely different invocations of Node.js." I'm OK with this because it's probably still an improvement over the current doc. But there's probably an even better way to show this that doesn't suggest that the value can change within a single process when it won't? |
@Trott I'm not part of documentation working group, but I could change that JS sintax to Shell, so instead of: // Node.js process was called with --inspect flag.require('inspector').url()
Debugger listeningonws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72Forhelpsee https://nodejs.org/en/docs/inspector
ws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72Could be more like: $ node --inspect -p "require('inspector').url()"Debugger listening on ws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72For help see https://nodejs.org/en/docs/inspectorws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72 |
Trott
commented
Sep 26, 2019
I could see that being a good option, especially if the commands in question work verbatim on Windows. |
juanarbol
commented
Sep 26, 2019
I'm not a Windows expert, but, I'd love to see the @nodejs/documentation opinions before making a new change, but yeah! I can change this for making this better. |
Trott
commented
Sep 27, 2019
I'm not a Windows expert, but I think those commands would work on Windows too. @nodejs/platform-windows |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
juanarbol
commented
Sep 28, 2019
I found something: "Return the URL of the active inspector, or "Return the URL of the active inspector, |
juanarbol
commented
Oct 3, 2019
Pong @Trott |
| Return the URL of the active inspector, or `undefined` if there is none. | ||
| ```console | ||
| $ node --inspect -p "require('inspector').url()" |
There was a problem hiding this comment.
Since built-in modules are automatically loaded when Node.js is run this way, we could consider simplifying to something like this here and below?:
| $ node --inspect -p "require('inspector').url()" | |
| $ node --inspect -p 'inspector.url()' |
There was a problem hiding this comment.
And adding to the suggested change above, we can make the output easier to read by making it clear what part of the output is from inspector.url() since there are a couple other lines of output that might confuse the reader?:
| $ node --inspect -p "require('inspector').url()" | |
| $ node --inspect -p '`\ninspector.url() result: ${inspector.url()}\n`'``` |
That makes the command line a little bit harder to read, but the output easier to read, so...
¯\(ツ)/¯
My comments above are suggestions only. If someone wants to run this on CI and land it as it is right now, I'm fine with that. |
juanarbol
commented
Oct 29, 2019
Ping @Trott, I think this is ready, is it? |
targos
commented
Dec 11, 2019
Landed in 4113601 |
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>
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>
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>
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>
Checklist