blob: c2be0ff0868d927e16148e940991a550e4dc0265 [file] [log] [blame]
var fs = require('fs')
var watchers = Object.create(null)
function refresh() {
process.kill('SIGHUP')
}
function collect() {
Object.keys(require.cache).forEach(function(path) {
if (!watchers[path]) {
if (path.indexOf('node_modules') === -1) {
watchers[path] = fs.watch(path, refresh)
}
}
})
}
module.exports = function() {
collect()
}