3 ms·
Is there anyone interested in improving the UX of the stock nodejs in-terminal debugger but who just needs money to do so? Because the experience of "run this s
by afarrell 10y ago
Is there anyone interested in improving the UX of the stock nodejs in-terminal debugger but who just needs money to do so? Because the experience of "run this single test and pop into the debugger at line 14 to poke around" has several warts that I'm surprised haven't been fixed yet:
1) Having to call `cont` at the beginning rather than the debugger stopping at the actual place where the `debugger` line is placed.
2) Having to call `repl` in order to start printing things
3) After calling `repl`, not being able to get back to the mode where you can go to the next line and jump into functions.
4) If jumping into an express.js route, inspecting the request sometimes just results in the message "no frames".
- AgentME 10y agoWhy not use chrome devtools to debug node? It's now a built-in feature as of v6.3.0 and no longer requires the 3rd-party and kinda buggy node-inspector module. Just use the --inspect command-line flag. (--debug-brk too if you want it to start paused on the first line.)
- nnq 10y agomaybe you're on a test server (no GUI) and for whatever reason you also don't want to remote debug with node-inspector, you want it all quick and dirty via ssh ;) Python's "baked in" command line debugger that you get via `import pdb; pdb.set_trace()` is awesome for this kind of quick and dirty ssh debugging so if you're looking for inspiration on how node's command line debugger should work, check it out. I always miss python's pdb when working with JS or PHP or... anything else.
- afarrell 10y ago1) Because then I have to move the mouse to click on tiny UI elements and that takes a long time. 2) Because then I need another browser window open and that takes up more screen real estate than a terminal 3) Because my browser background is white and reading code on it is less pleasant 4) Because then the place where I say "run these backend tests" and the place where I pop into the debugger are different.
- shados 10y agoas mentionned, now the chrome debugger is a first class citizen for Node. You don't need iron-node or node-inspector... just run node with --inspect (and optionally --debug-brk) and hit the url that it returns with Chrome. Works beautifully.