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.2.5 to 0.2.6

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# Chokidar 0.2.6 (June 8, 2012)
* Prevented creating of duplicate 'add' events.
# Chokidar 0.2.5 (June 8, 2012)

@@ -2,0 +5,0 @@ * Fixed a bug when new files in new directories hadn't been added.

15

lib/index.js

@@ -21,5 +21,5 @@ 'use strict';

function FSWatcher(options) {
this.options = options = options != null ? options : {};
this.options = options = options != null ? options : Object.create(null);
this._handle = this._handle.bind(this);
this.watched = {};
this.watched = Object.create(null);
this.watchers = [];

@@ -102,3 +102,3 @@ if (this.options.persistent == null) {

// Returns nothing.
FSWatcher.prototype._watch = function(item, callback) {
FSWatcher.prototype._watch = function(item, itemType, callback) {
var _this = this;

@@ -110,2 +110,3 @@ var options, watcher;

var parent = this._getWatchedDir(directory);
// Prevent memory leaks.

@@ -134,2 +135,3 @@ if (parent.indexOf(basename) >= 0) return;

}
if (itemType === 'file') _this.emit('add', item);
};

@@ -145,6 +147,5 @@

var _this = this;
this._watch(file, function(file) {
_this._watch(file, 'file', function(file) {
_this.emit('change', file);
});
this.emit('add', file);
};

@@ -191,3 +192,3 @@

read(directory);
this._watch(directory, read);
this._watch(directory, 'directory', read);
};

@@ -244,3 +245,3 @@

});
this.watched = {};
this.watched = Object.create(null);
return this;

@@ -247,0 +248,0 @@ };

{
"name": "chokidar",
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.",
"version": "0.2.5",
"version": "0.2.6",
"keywords": ["fs", "watch", "watchFile", "watcher", "file"],

@@ -6,0 +6,0 @@ "homepage": "https://github.com/paulmillr/chokidar",

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