I created a script in Javascript using Node.js to scrape some data from a website overnight. We'll, I'm at 67% and it's going to take about 5-6 more hours to finish. But I have enough data at the moment that I'd like to stop it.
Is there a way to pause script execution into a Node REPL session and inspect the variables? Or something similar?
(I'm scraping data into an array).
Thanks
You can put Node in debug mode (which can pause execution) by sending a USR1 signal to it. Check out https://github.com/dannycoates/node-inspector/
ps -x | grep node
kill -s USR1 $pid
node-inspector &
http://localhost:8080/debug?port=5858