Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.6.2 to 0.6.3

setup.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# Chokidar 0.6.3 (12 August 2013)
* Added `usePolling` option (default: `true`).
When `false`, chokidar will use `fs.watch` as backend.
`fs.watch` is much faster, but not like super reliable.
# Chokidar 0.6.2 (19 March 2013)

@@ -2,0 +7,0 @@ * Fixed watching initially empty directories with `ignoreInitial` option.

46

lib/index.js

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

// Generated by CoffeeScript 1.4.0
// Generated by CoffeeScript 1.6.3
(function() {
'use strict';
var EventEmitter, FSWatcher, fs, isBinary, nodeVersion, sysPath,

@@ -22,49 +21,40 @@ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },

exports.FSWatcher = FSWatcher = (function(_super) {
__extends(FSWatcher, _super);
function FSWatcher(options) {
var _base, _base1, _base2, _base3, _base4, _ref, _ref1, _ref2, _ref3, _ref4,
var _base, _base1, _base2, _base3, _base4, _base5,
_this = this;
this.options = options != null ? options : {};
this.close = __bind(this.close, this);
this.add = __bind(this.add, this);
this._handle = __bind(this._handle, this);
this._handleDir = __bind(this._handleDir, this);
this._handleFile = __bind(this._handleFile, this);
this._watch = __bind(this._watch, this);
this._remove = __bind(this._remove, this);
this._hasReadPermissions = __bind(this._hasReadPermissions, this);
this._removeFromWatchedDir = __bind(this._removeFromWatchedDir, this);
this._addToWatchedDir = __bind(this._addToWatchedDir, this);
this._getWatchedDir = __bind(this._getWatchedDir, this);
FSWatcher.__super__.constructor.apply(this, arguments);
this.watched = Object.create(null);
this.watchers = [];
if ((_ref = (_base = this.options).persistent) == null) {
if ((_base = this.options).persistent == null) {
_base.persistent = false;
}
if ((_ref1 = (_base1 = this.options).ignoreInitial) == null) {
if ((_base1 = this.options).ignoreInitial == null) {
_base1.ignoreInitial = false;
}
if ((_ref2 = (_base2 = this.options).ignorePermissionErrors) == null) {
if ((_base2 = this.options).ignorePermissionErrors == null) {
_base2.ignorePermissionErrors = false;
}
if ((_ref3 = (_base3 = this.options).interval) == null) {
if ((_base3 = this.options).interval == null) {
_base3.interval = 100;
}
if ((_ref4 = (_base4 = this.options).binaryInterval) == null) {
if ((_base4 = this.options).binaryInterval == null) {
_base4.binaryInterval = 300;
}
if ((_base5 = this.options).usePolling == null) {
_base5.usePolling = true;
}
this.enableBinaryInterval = this.options.binaryInterval !== this.options.interval;

@@ -89,5 +79,5 @@ this._ignored = (function(ignored) {

FSWatcher.prototype._getWatchedDir = function(directory) {
var dir, _base, _ref;
var dir, _base;
dir = directory.replace(/[\\\/]$/, '');
return (_ref = (_base = this.watched)[dir]) != null ? _ref : _base[dir] = [];
return (_base = this.watched)[dir] != null ? (_base = this.watched)[dir] : _base[dir] = [];
};

@@ -146,8 +136,3 @@

this._addToWatchedDir(directory, basename);
if (process.platform === 'win32' && nodeVersion === '0.6') {
watcher = fs.watch(item, options, function(event, path) {
return callback(item);
});
return this.watchers.push(watcher);
} else {
if (this.options.usePolling) {
options.interval = this.enableBinaryInterval && isBinary(basename) ? this.options.binaryInterval : this.options.interval;

@@ -159,2 +144,7 @@ return fs.watchFile(item, options, function(curr, prev) {

});
} else {
watcher = fs.watch(item, options, function(event, path) {
return callback(item);
});
return this.watchers.push(watcher);
}

@@ -161,0 +151,0 @@ };

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.4.0
// Generated by CoffeeScript 1.6.3
(function() {

@@ -3,0 +3,0 @@ var extensions, exts, isBinary, isBinaryPath, sysPath;

{
"name": "chokidar",
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.",
"version": "0.6.2",
"version": "0.6.3",
"keywords": [

@@ -29,4 +29,5 @@ "fs",

"scripts": {
"prepublish": "coffee -o lib/ src/",
"test": "mocha --compilers coffee:coffee-script --require test/common.js --colors"
"prepublish": "node setup.js prepublish",
"postpublish": "node setup.js postpublish",
"test": "node setup.js test"
},

@@ -33,0 +34,0 @@ "dependencies": {},

@@ -11,3 +11,3 @@ # Chokidar

* Has only one non-useful event: `rename`.
* Has [a lot of other issues](https://github.com/joyent/node/issues/search?utf8=✓&q=fs.watch)
* Has [a lot of other issues](https://github.com/joyent/node/search?q=fs.watch&type=Issues)

@@ -23,3 +23,3 @@ Node.js `fs.watchFile`:

[socketstream](http://www.socketstream.org),
and [testacular](https://github.com/vojtajina/testacular/)
and [karma](http://karma-runner.github.io)
and had proven itself in production env.

@@ -60,3 +60,5 @@

* `chokidar.watch(paths, options)`: takes paths to be watched and options:
* `options.ignored` (regexp or function) files to be ignored. Example:
* `options.ignored` (regexp or function) files to be ignored.
This function or regexp is tested against the **whole path**,
not just filename. Example:
`chokidar.watch('file', {ignored: /^\./})`.

@@ -70,3 +72,7 @@ * `options.persistent` (default: `false`). Indicates whether the process

* `options.interval` (default: `100`). Interval of file system polling.
* `options.binaryInterval` (default: `300`). Interval of file system polling for binary files (see extensions in src/is-binary).
* `options.binaryInterval` (default: `300`). Interval of file system
polling for binary files (see extensions in src/is-binary).
* `options.usePolling` (default: `true`). Whether to use fs.watchFile
(backed by polling), or fs.watch. If polling leads to high CPU utilization,
consider setting this to `false`.

@@ -73,0 +79,0 @@ `chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:

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