Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,7 @@ | ||
# Chokidar 0.4.0 (July 26, 2012) | ||
* Added `all` event that receives two args (event name and path) that | ||
combines `add`, `change` and `unlink` events. | ||
* Switched to `fs.watchFile` on node.js 0.8 on windows. | ||
* Files are now correctly unwatched after unlink. | ||
# Chokidar 0.3.0 (June 24, 2012) | ||
@@ -2,0 +8,0 @@ * `unlink` event are no longer emitted for directories, for consistency |
@@ -5,6 +5,7 @@ // Generated by CoffeeScript 1.3.3 | ||
var EventEmitter, FSWatcher, fs, sysPath, | ||
var EventEmitter, FSWatcher, fs, nodeVersion, sysPath, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
__hasProp = {}.hasOwnProperty, | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
__slice = [].slice; | ||
@@ -17,2 +18,4 @@ EventEmitter = require('events').EventEmitter; | ||
nodeVersion = process.versions.node.substring(0, 3); | ||
exports.FSWatcher = FSWatcher = (function(_super) { | ||
@@ -100,2 +103,3 @@ | ||
}); | ||
fs.unwatchFile(fullPath); | ||
return this.emit('unlink', fullPath); | ||
@@ -120,3 +124,3 @@ }; | ||
this._addToWatchedDir(directory, basename); | ||
if (process.platform === 'win32') { | ||
if (process.platform === 'win32' && nodeVersion === '0.6') { | ||
watcher = fs.watch(item, options, function(event, path) { | ||
@@ -198,2 +202,11 @@ return callback(item); | ||
FSWatcher.prototype.emit = function() { | ||
var args, event; | ||
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
FSWatcher.__super__.emit.apply(this, arguments); | ||
if (event === 'add' || event === 'change' || event === 'unlink') { | ||
return FSWatcher.__super__.emit.apply(this, ['all', event].concat(__slice.call(args))); | ||
} | ||
}; | ||
FSWatcher.prototype.add = function(files) { | ||
@@ -200,0 +213,0 @@ if (!Array.isArray(files)) { |
{ | ||
"name": "chokidar", | ||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"keywords": ["fs", "watch", "watchFile", "watcher", "file"], | ||
@@ -30,5 +30,5 @@ "homepage": "https://github.com/paulmillr/chokidar", | ||
"devDependencies": { | ||
"mocha": "1.0.1", | ||
"mocha": "1.3.0", | ||
"expect.js": "0.1.2" | ||
} | ||
} |
@@ -59,3 +59,3 @@ # Chokidar | ||
* `.on(event, callback)`: listen for an FS event. | ||
Available events: add, change, unlink, error. | ||
Available events: `add`, `change`, `unlink`, `error`, `all`. | ||
* `.close()`: remove all listeners from watched files. | ||
@@ -62,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19634
229
1