Code for breakfast.

How to inspect an already-running Node.js process

Ever need to debug something in dev but forget to start your process with --inspect? Turns out you can save yourself a restart and take advantage of Unix signals. Just grab your program's PID and run the following:

kill -USR1 $your_process_id

Don't worry, this won't actually terminate the process, it just sends signal to the Node runtime.

You should see the familiar inspector message log in your program's output:

Debugger listening on ws://<uid here>
For help see

(Tip: If your program eats the output, check chrome://inspect)