Node.js don't restart server when changing .js files?

543 Views Asked by At

I'm currently using node-supervisor so that node picks up .js changes, it works good but I've noticed it restarts the server everytime I save a js file. Is there a way to save a server-side .js file but not restart the server, yet have the changes automatically loaded into node? I.e., the process won't exit but somehow just update itself with the new changes.

1

There are 1 best solutions below

1
On

You cannot load code in in real-time because of the complications you would get (for example memory leaks), But in theory you should be able to do this with modules.

You could have a look at this: livenode, It is not recommended to use in production environment though