Ability to trigger --inspect --inspect-brk from code #29250
Labels
feature request
Issues that request new features to be added to Node.js.
inspector
Issues and PRs related to the V8 inspector protocol
Is your feature request related to a problem? Please describe.
Yes, I've a node.js CLI app which I'd like to enable debugging off via setting
DEBUG=my-cli
before running my program; As it uses#!
and other things, I can't set the flags to thenode
executable.I have discovered I can start the inspector programmatically, but not in
--inspect-brk
mode, so my program runs and exits before I can connect to the inspector.Describe the solution you'd like
Ideally, it'd be great to have some sort of API like:
Inspector.start()
orInspector.start({ break: true })
to start the inspector and also make it break-point immediately, even though no clients are yet connected to the inspector.Describe alternatives you've considered
There's not really other alternatives, other than doing:
I don't think I can do:
Which isn't ideal, as it's leaking internals of how my package works to consumers, whereas
DEBUG=my-cli my-cli
doesn'tThe text was updated successfully, but these errors were encountered: