| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@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? |
Sorry, something went wrong.
|
@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 listening on ws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72
For help see 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-1d74a161cd72
For help see https://nodejs.org/en/docs/inspector
ws://127.0.0.1:9229/136e8c71-8901-43d8-b666-1d74a161cd72 |
Sorry, something went wrong.
I could see that being a good option, especially if the commands in question work verbatim on Windows. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
I'm not a Windows expert, but I think those commands would work on Windows too. @nodejs/platform-windows |
Sorry, something went wrong.
|
I found something: "Return the URL of the active inspector, or undefined if there is none.", and by the way, In default options, I see that, by default, debugger is 127.0.0.1:9229, maybe, maybe... say that could improves documentation: "Return the URL of the active inspector, 127.0.0.1:9229 by default, or undefined if there is none." With better sintax, of course. |
Sorry, something went wrong.
| 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()' |
Sorry, something went wrong.
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...
¯\(ツ)/¯
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
Ping @Trott, I think this is ready, is it? |
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/27528/ |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
Checklist