Sha256: 10956a3b5eac8d35086341b2e2154f6e028f3a58c596a56433c15e3ed7bc1069
Contents?: true
Size: 985 Bytes
Versions: 62
Compression:
Stored size: 985 Bytes
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var path = require("path"); function WatcherManager() { this.directoryWatchers = {}; } WatcherManager.prototype.getDirectoryWatcher = function(directory) { var DirectoryWatcher = require("./DirectoryWatcher"); if(!this.directoryWatchers[directory]) { this.directoryWatchers[directory] = new DirectoryWatcher(directory, {}); this.directoryWatchers[directory].on("closed", function() { delete this.directoryWatchers[directory]; }.bind(this)); } return this.directoryWatchers[directory]; }; WatcherManager.prototype.watchFile = function watchFile(p, startTime) { var directory = path.dirname(p); return this.getDirectoryWatcher(directory).watch(p, startTime); }; WatcherManager.prototype.watchDirectory = function watchDirectory(directory, startTime) { return this.getDirectoryWatcher(directory).watch(directory, startTime); }; module.exports = new WatcherManager();
Version data entries
62 entries across 62 versions & 1 rubygems