/dev tips

🎊   Announcing the new DevTools Pre Launch ModernDevTools.com - A discount, and no subscription fees during this pre-launch period   🎊

(74) Screencasting A better Inspect Element (76)

Chrome DevTools: Debug Node.js code using remote debugging

14 Oct 2015
Debug Node.js code using remote debugging

Did you know tools like Node Inspector or Iron Node can be used to debug your node.js code?

Using Node Inspector as an example (npm install -g node-inspector), instead of running:

node index.js

You can run this instead:

node-debug index.js

In the example, I then go to a special DevTools URL: http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858 which gives access to DevTools features for Node. You can set breakpoints, evaluate new JavaScript code in the Node.js context, collect heap snapshots & even live-edit JavaScript.

Sign up to receive a developer tip, in the form of a gif, in your inbox each week.