You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
I've implemented a library that makes spawning a debugger for node applications extremely easy.
However, chrome does not allow opening chrome-devtools:// urls on launch - the user has to manually paste it into the address bar.
It would be awesome if I could use ndb for that! I.e. if ndb provides a CLI option to specify the debug port ndb connects to.
The text was updated successfully, but these errors were encountered:
You can spawn ndb process and add file to os.homedir()/.ndb/ndd_store/<pid>
With following content: {"targetListUrl":"http://127.0.0.1:<port>/json","argv":process.argv],"cwd":process.cwd()}
ndb will detect this process and automatically attach to it.
I am wondering how does your nice library get websocket url?
Thanks for your answer :) Does this allow debugging multiple processes in parallel? Generally, I don't like to pass launch arguments by writing into global files as this is prone to race conditions and other bugs.
Getting the websocket url is quite easy, the node debugger hosts a rest endoint for that.
Or do you mean how I get the url for the rest endoint? It's just localhost + port. I open the port with process._debug. I've put a sequence diagram in the Readme.
In general I prefer some node flag that will radically simplify node process discovery, I have open pull request for node: nodejs/node#28235 . If it will get merge ndb will run ipc server and you will be able to send detected web socket URL to this server instead of writing to files.
ndb@1.1.0 runs a little ipc server, external tool can send required information about process to it.
User can get ipc address on Terminal tab in Console drawer (available by Esc), it is listed as NDD_IPC. For expected data format, please take a look on preload.js.
I will think about ways how I can eliminate dependency on NDD_IPC environment variable.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've implemented a library that makes spawning a debugger for node applications extremely easy.
However, chrome does not allow opening
chrome-devtools://
urls on launch - the user has to manually paste it into the address bar.It would be awesome if I could use ndb for that! I.e. if ndb provides a CLI option to specify the debug port ndb connects to.
The text was updated successfully, but these errors were encountered: