Good debugger for JavaScript? Is there one for Atom?


#1

Hi, I have a question that probably has been asked before… but I’ll spring it again:

I was hoping I could find a package that specialized in debugging JavaScript code. The only one I could find was one for Node.js! I tried installing it but it just complains that I don’t have Node installed. Is that the only package I can use? Do I really have to install all of Node.js in order to use a debugger for simple javascript?

Thanks,

Jeff


#2

Which package is this?


#3

Well, beside server-side JavaScript, which is mostly used with Node.js (or Windows shell scripts!), we mostly use JS in browser, so we debug using the development tools provided by these browsers. Chrome dev tools are excellent, Firefox’ ones are OK, much better in the developer edition, I suppose Edge’s dev tools are OK too.


#4

Are you trying to debug an Atom package? Or JavaScript you’re writing for something else? If it is for something else, then @PhiLho is most likely correct. If for an Atom package, you can open the developer tools in Atom by following the instructions in the Flight Manual.


#5

Hi… Sorry for my late reply: https://atom.io/packages/node-debugger

Leedohm, Yes I was just looking for a simple debugger for snippets of JS. (I am not looking to debug Atom).

I’m on the learning path in Free code Camp…and I have the itching desire to set watch points and observe what happens as I iterate from break points. I will keep trying, but my experience with trying to use the Chrome debugger keeps ending up to be a complete mess! I am not sure how to drill down to find the Darned JS I am trying to test. What I would like to do is just copy and paste a self contained JS code snippet in a nice Atom format and be able to set breakpoints, watch values.,etc and step through the code logic directly from Atom so that I can observe its behavior…
Jeff


#6

I’ve been using this website:
http://www.pythontutor.com/live.html#mode=edit
Just make sure to set “Write Code in” as JavaScript ES6


#7

Being limited to Chrome Dev Tools is freakishly limited and cumbersome. For instance, trying to debug unit tests written for Mocha means you have to

  • using Atom add a debugger statement in the test (since the source code isn’t available for browser on mocha startup, even when using --inspect-brk)
  • start the Mocha running with --inspect-brk
  • connect to the debugger using Chrome’s remote V8 debugging utilities
  • press Continue in Dev Tools

Then finally, you might stop at your breakpoint! That’s so annoyingly crude, and like programming in the stone age. Even C programming in the seventies had nicer tooling than that!
I don’t blame the TS for wanting something nicer.

Compare that to working with WebStorm:

  • set a breakpoint in the test using WS
  • press Shift-F10 (to run the test) in WS

Of course, there needs to be something better for people actually being payed to produce working code. Otherwise you are wasting time and money. The one I have found for my coworkers is Nuclide.