Is there a way to automatically reload node-inspector when server restarts?

1.7k Views Asked by At

It's a fairly small thing, but it feels like I'm manually refreshing the node-inspector tab in chrome a million times a day, and there must be a better way.

When a file changes, and node restarts, and node-inspector detaches from target -- is there a way for it to automatically re-attach itself?

2

There are 2 best solutions below

0
On BEST ANSWER

This question is a duplicate of How can I make node-inspector restart when node is restarted?. See the accepted answer for a workaround solution using GreaseMonkey.

There is also a GitHub issue filled in the Node Inspector project: #266.

0
On

Here's instructions to have a Node console (not REPL), while using nodemon, with a server output console, all from within VSCode.

Node.js debugging in VS Code with Nodemon

The only thing to look out for is that it needs to be started manually with

nodemon --inspect ./bin/www

You can't let nodemon use your package.json start defaults because it won't restart.

The only thing this lacks is a webpage restart (if you're using web front end) but that's a whole other question.