Is there any tool that enables you to \"hot swap\" JavaScript contents while executing a webpage?
I am looking for something similar to what HotSpot does for Java,
You can easily hot-reload JavaScript code with the RequireJS front-end module system, I wrote an article about it recently (September 2015)
https://medium.com/@the1mills/hot-reloading-with-react-requirejs-7b2aa6cb06e1
you basically delete the cache for an AMD module and RequireJS will go fetch the new one from the filesystem.
the trick is to use websockets (socket.io works fine) to tell the browser that the file has changed, and to delete the cache and re-require the file.
the rest of the info is in the article