Socket
Socket
Sign inDemoInstall

chokidar

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokidar - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

6

CHANGELOG.md

@@ -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

19

lib/index.js

@@ -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)) {

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc