+4
-1
@@ -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); | ||
| }); |
+19
-13
@@ -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 { |
+2
-2
| { | ||
| "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" | ||
| } | ||
| } |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
35291
0.79%732
0.83%7
133.33%