thlorenz / replpad

Pipes content of files to a node repl whenever they change to enable a highly interactive coding experience.
http://thlorenz.github.com/replpad/
MIT License
213 stars 19 forks source link

clear require cache before piping a file #5

Open thlorenz opened 11 years ago

thlorenz commented 11 years ago

Right now changes in bar will not be picked up when I source foo, that requires, it a second time.

Therefore it would be useful to run: Object.keys(require.cache).forEach(function (k) { delete require.cache[k] }) before I pipe file content into the repl to ensure that its dependencies get refreshed as well.