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.8.3 to 0.8.4

5

example.js

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

require('./').watch('lib', {ignored: /[\/\\]\./}).on('all', function(event, path) {
require('./').watch('.', {
ignored: /node_modules|\.git/,
persistent: true
}).on('all', function(event, path) {
console.log(event, path);
});

32

index.js

@@ -65,12 +65,15 @@ 'use strict';

if (opts.binaryInterval == null) opts.binaryInterval = 300;
if (opts.usePolling == null) opts.usePolling = (!isWindows && !canUseFsEvents);
if (opts.useFsEvents == null) {
opts.useFsEvents = !opts.usePolling && canUseFsEvents;
} else {
if (!canUseFsEvents) opts.useFsEvents = false;
}
if (opts.ignorePermissionErrors == null) {
opts.ignorePermissionErrors = false;
}
// Use polling on Mac and Linux.
// Disable polling on Windows.
if (opts.usePolling == null) opts.usePolling = !isWindows;
// Enable fsevents on OS X when polling is disabled.
// Which is basically super fast watcher.
if (opts.useFsEvents == null) opts.useFsEvents = !opts.usePolling;
// If we can't use fs events, disable it in any case.
if (!canUseFsEvents) opts.useFsEvents = false;
if (opts.ignorePermissionErrors == null) opts.ignorePermissionErrors = false;
this.enableBinaryInterval = opts.binaryInterval !== opts.interval;

@@ -177,4 +180,5 @@

var createFSEventsInstance = function(path, callback) {
var watcher = new fsevents.FSEvents(path);
var watcher = new fsevents(path);
watcher.on('fsevent', callback);
watcher.start();
return watcher;

@@ -211,3 +215,3 @@ };

return fs.stat(path, function(error, stats) {
return emit((error || !stats ? 'unlink' : 'add'));
return emit(error || !stats ? 'unlink' : 'add');
});

@@ -384,5 +388,7 @@ }

if (error != null) return _this._emitError(error);
dirFiles.filter(function(path) {
dirFiles
.filter(function(path) {
return !_this._isIgnored(path);
}).forEach(handle);
})
.forEach(handle);
});

@@ -389,0 +395,0 @@ } else {

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

@@ -40,5 +40,5 @@ "fs",

"optionalDependencies": {
"fsevents": "0.2.0",
"fsevents": "pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138",
"recursive-readdir": "0.0.2"
}
}
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