Skip to content

Instantly share code, notes, and snippets.

@Psvensso
Created June 7, 2019 05:56
Show Gist options
  • Save Psvensso/fde01bb9e5d4ec563aa55f2330c1aac1 to your computer and use it in GitHub Desktop.
Save Psvensso/fde01bb9e5d4ec563aa55f2330c1aac1 to your computer and use it in GitHub Desktop.
Node debugger

node --inspect-brk ./node_modules/.bin/webpack (or whatever file) to start the debugging process. The process will halt at the first line and print a debugger URL. Copy the debugger URL into the Chrome Browser and the developers tools will initialize.

Then go to the JavaScript profiler tab and start profiling After you've pressed stop, the flame graph will be generated.

If you don't want to copy debugger URLs around, you can also use the NIM chrome extension. It discovers debuggable node processes automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment