News for hackers. Stuff that matters.
Re:V8, Advanced JavaScript, and the Next Performance Frontie... by talawahdotnet on Monday May 29, 2017 @09:44PM (#14442557)
Demo showing how to debug node code using Chrome DevTools at 26:18[1]. Very cool if you don't already have a full blown IDE with debugging built in. Or even if you just want to inspect some random node library/code on the fly.

1. https://youtu.be/EdFDJANJJLs?t=26m18s

Re:V8, Advanced JavaScript, and the Next Performance Frontie... by afarrell on Tuesday May 30, 2017 @04:25AM (#14443699)
I wish node also has a full-featured server-side debugger that worked in the terminal.

When I'm writing server-side code and popping `debugger;` into my unit test, I really don't want to go to open up a chrone window and use my mouse to fiddle with the sizes of the panes to make debugging in chrome work. It looks like this protocol could eliminate the problem of waiting for the connection to come through (it drops a lot of the time when you do it within unit tests), which is great.

If I wanted to get started adding this to node.js, does anyone have any suggestions for where I would start? Presumably by first getting a solid mental model of V8's internals, but has anyone else worked on debuggers that could give me some pointers?

Re:V8, Advanced JavaScript, and the Next Performance Frontie... by mscdex on Tuesday May 30, 2017 @12:40PM (#14446546)
Re:V8, Advanced JavaScript, and the Next Performance Frontie... by STRML on Tuesday May 30, 2017 @06:53PM (#14449223)
It does - and has for a long time:

https://nodejs.org/api/debugger.html

Re:V8, Advanced JavaScript, and the Next Performance Frontie... by swah on Tuesday May 30, 2017 @10:34AM (#14445647)
Any IDEs you think are better than this?
Re:V8, Advanced JavaScript, and the Next Performance Frontie... by gear54rus on Monday May 29, 2017 @10:04PM (#14442634)
Have you by chance found how to do that with babel-node?

It seems that after introducing a built-in chrome protocol debugger node-inspector was abandoned and now I can't figure out how to use the built-in debugger with babel-node.

Re:V8, Advanced JavaScript, and the Next Performance Frontie... by paulirish on Monday May 29, 2017 @11:35PM (#14442878)
I just tested and it looks like `babel-node --inspect` works fine. However `--inspect-brk` does require this small PR: https://github.com/babel/babel/pull/5785

And FWIW, my written guide here captures the basics that Seth covered in the video: https://medium.com/@paul_irish/debugging-node-js-nightlies-w...