diff --git a/lib/index.js b/lib/index.js index b0a73b83..a6556fce 100644 --- a/lib/index.js +++ b/lib/index.js @@ -45,7 +45,7 @@ function FSWatcher(options) { FSWatcher.prototype = Object.create(EventEmitter.prototype); FSWatcher.prototype._getWatchedDir = function(directory) { - directory = directory.replace(/\/$/, ''); + directory = directory.replace(/[\\\/]$/, ''); if (this.watched[directory] == null) this.watched[directory] = []; return this.watched[directory]; };