Comparing version 1.1.2 to 1.1.3
@@ -5,3 +5,3 @@ /* | ||
* | ||
* Copyright (c) 2016 Kyle Robinson Young | ||
* Copyright (c) 2018 Kyle Robinson Young | ||
* Licensed under the MIT license. | ||
@@ -274,2 +274,4 @@ */ | ||
Gaze.prototype._addToWatched = function (files) { | ||
var dirs = []; | ||
for (var i = 0; i < files.length; i++) { | ||
@@ -290,2 +292,9 @@ var file = files[i]; | ||
dirs.push(dirname); | ||
} | ||
dirs = helper.unique(dirs); | ||
for (var k = 0; k < dirs.length; k++) { | ||
dirname = dirs[k]; | ||
// add folders into the mix | ||
@@ -300,2 +309,3 @@ var readdir = fs.readdirSync(dirname); | ||
} | ||
return this; | ||
@@ -302,0 +312,0 @@ }; |
{ | ||
"name": "gaze", | ||
"description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"homepage": "https://github.com/shama/gaze", | ||
@@ -20,3 +20,3 @@ "author": { | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
"node": ">= 4.0.0" | ||
}, | ||
@@ -30,10 +30,10 @@ "scripts": { | ||
"devDependencies": { | ||
"async": "^1.5.2", | ||
"async": "^2.6.1", | ||
"grunt": "^1.0.1", | ||
"grunt-benchmark": "^0.3.0", | ||
"grunt-benchmark": "^1.0.0", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-contrib-nodeunit": "^1.0.0", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
"grunt-contrib-nodeunit": "^2.0.0", | ||
"rimraf": "^2.5.2", | ||
"semistandard": "^7.0.5" | ||
"semistandard": "^12.0.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "keywords": [ |
# gaze [![Build Status](http://img.shields.io/travis/shama/gaze.svg)](https://travis-ci.org/shama/gaze) [![Build status](https://ci.appveyor.com/api/projects/status/vtx65w9eg511tgo4)](https://ci.appveyor.com/project/shama/gaze) | ||
A globbing fs.watch wrapper built from the best parts of other fine watch libs. | ||
Compatible with Node.js 4.x/0.12/0.10, Windows, OSX and Linux. | ||
A globbing `fs.watch` wrapper built from the best parts of other fine watch libs. | ||
Compatible with Node.js >= 4.x, Windows, macOS, and Linux. | ||
@@ -89,3 +89,3 @@ ![gaze](http://dontkry.com/images/repos/gaze.png) | ||
See [isaacs's minimatch](https://github.com/isaacs/minimatch) for more | ||
See [isaacs's `minimatch`](https://github.com/isaacs/minimatch) for more | ||
information on glob patterns. | ||
@@ -97,11 +97,11 @@ | ||
* `patterns` {String|Array} File patterns to be matched | ||
* `options` {Object} | ||
* `callback` {Function} | ||
* `err` {Error | null} | ||
* `watcher` {Object} Instance of the Gaze watcher | ||
* `patterns` {`String`|`Array`} File patterns to be matched | ||
* `options` {`Object`} | ||
* `callback` {`Function`} | ||
* `err` {`Error` | `null`} | ||
* `watcher` {`Object`} Instance of the `Gaze` watcher | ||
### Class: gaze.Gaze | ||
### Class: `gaze.Gaze` | ||
Create a Gaze object by instancing the `gaze.Gaze` class. | ||
Create a `Gaze` object by instancing the `gaze.Gaze` class. | ||
@@ -116,3 +116,3 @@ ```javascript | ||
* `options` The options object passed in. | ||
* `interval` {integer} Interval to pass to fs.watchFile | ||
* `interval` {integer} Interval to pass to `fs.watchFile` | ||
* `debounceDelay` {integer} Delay for events called in succession for the same | ||
@@ -126,3 +126,3 @@ file/event in milliseconds | ||
* `ready(watcher)` When files have been globbed and watching has begun. | ||
* `all(event, filepath)` When an `added`, `changed` or `deleted` event occurs. | ||
* `all(event, filepath)` When an `added`, `changed`, `renamed`, or `deleted` event occurs. | ||
* `added(filepath)` When a file has been added to a watch directory. | ||
@@ -138,7 +138,7 @@ * `changed(filepath)` When a file has been changed. | ||
* `emit(event, [...])` Wrapper for the EventEmitter.emit. | ||
`added`|`changed`|`deleted` events will also trigger the `all` event. | ||
* `emit(event, [...])` Wrapper for `EventEmitter.emit`. | ||
`added`|`changed`|`renamed`|`deleted` events will also trigger the `all` event. | ||
* `close()` Unwatch all files and reset the watch instance. | ||
* `add(patterns, callback)` Adds file(s) patterns to be watched. | ||
* `remove(filepath)` removes a file or directory from being watched. Does not | ||
* `add(patterns, callback)` Adds file(s) `patterns` to be watched. | ||
* `remove(filepath)` Removes a file or directory from being watched. Does not | ||
recurse directories. | ||
@@ -154,7 +154,7 @@ * `watched()` Returns the currently watched files. | ||
* [paulmillr's chokidar](https://github.com/paulmillr/chokidar) | ||
* [amasad's sane](https://github.com/amasad/sane) | ||
* [mikeal's watch](https://github.com/mikeal/watch) | ||
* [github's pathwatcher](https://github.com/atom/node-pathwatcher) | ||
* [bevry's watchr](https://github.com/bevry/watchr) | ||
* [paulmillr's `chokidar`](https://github.com/paulmillr/chokidar) | ||
* [amasad's `sane`](https://github.com/amasad/sane) | ||
* [mikeal's `watch`](https://github.com/mikeal/watch) | ||
* [github's `pathwatcher`](https://github.com/atom/node-pathwatcher) | ||
* [bevry's `watchr`](https://github.com/bevry/watchr) | ||
@@ -167,28 +167,29 @@ ## Contributing | ||
## Release History | ||
* 1.1.2 - Prevent more ENOENT errors from escaping (@alexgorbatchev). | ||
* 1.1.1 - Prevent fs.watch errors from escaping error handler (@rosen-vladimirov). Fix _addToWatched without path.sep (@wyicwx). | ||
* 1.1.3 - Fix for Node 10 support (@aredridel). Officially dropping support for Node < 4. | ||
* 1.1.2 - Prevent more `ENOENT` errors from escaping (@alexgorbatchev). | ||
* 1.1.1 - Prevent `fs.watch` errors from escaping error handler (@rosen-vladimirov). Fix `_addToWatched` without `path.sep` (@wyicwx). | ||
* 1.1.0 - Update to `globule@1.0.0` with `minimatch >= 3.0.0`. | ||
* 1.0.0 - Revert back to 0.5.2. Drop support for Node.js v0.8. Fix for `maxListeners`. Update globule to `0.2.0`. | ||
* 0.6.4 - Catch and emit error from readdir (@oconnore). Fix for 0 maxListeners. Use graceful-fs to avoid EMFILE errors in other places fs is used. Better method to determine if pathwatcher was built. Fix keeping process alive too much, only init pathwatcher if a file is being watched. Set min required to Windows Vista when building on Windows (@pvolok). | ||
* 0.6.3 - Add support for node v0.11 | ||
* 0.6.2 - Fix argument error with watched(). Fix for erroneous added events on folders. Ignore msvs build error 4244. | ||
* 1.0.0 - Revert back to 0.5.2. Drop support for Node.js v0.8. Fix for `maxListeners`. Update `globule` to `0.2.0`. | ||
* 0.6.4 - Catch and emit `error` from `readdir` (@oconnore). Fix for `0 maxListeners`. Use `graceful-fs` to avoid `EMFILE` errors in other places `fs` is used. Better method to determine if `pathwatcher` was built. Fix keeping process alive too much, only init `pathwatcher` if a file is being watched. Set min required to Windows Vista when building on Windows (@pvolok). | ||
* 0.6.3 - Add support for Node.js v0.11 | ||
* 0.6.2 - Fix argument error with `watched()`. Fix for erroneous `added` events on folders. Ignore `msvs` build error 4244. | ||
* 0.6.1 - Fix for absolute paths. | ||
* 0.6.0 - Uses native OS events (fork of pathwatcher) but can fall back to stat polling. Everything is async to avoid blocking, including `relative()` and `watched()`. Better error handling. Update to globule@0.2.0. No longer watches `cwd` by default. Added `mode` option. Better `EMFILE` message. Avoids `ENOENT` errors with symlinks. All constructor arguments are optional. | ||
* 0.5.2 - Fix for ENOENT error with non-existent symlinks [BACKPORTED]. | ||
* 0.5.1 - Use setImmediate (process.nextTick for node v0.8) to defer ready/nomatch events (@amasad). | ||
* 0.5.0 - Process is now kept alive while watching files. Emits a nomatch event when no files are matching. | ||
* 0.6.0 - Uses native OS events (fork of `pathwatcher`) but can fall back to stat polling. Everything is async to avoid blocking, including `relative()` and `watched()`. Better error handling. Update to `globule@0.2.0`. No longer watches `cwd` by default. Added `mode` option. Better `EMFILE` message. Avoids `ENOENT` errors with symlinks. All constructor arguments are optional. | ||
* 0.5.2 - Fix for `ENOENT` error with non-existent symlinks [BACKPORTED]. | ||
* 0.5.1 - Use `setImmediate` (`process.nextTick` for Node.js v0.8) to defer `ready`/`nomatch` events (@amasad). | ||
* 0.5.0 - Process is now kept alive while watching files. Emits a `nomatch` event when no files are matching. | ||
* 0.4.3 - Track file additions in newly created folders (@brett-shwom). | ||
* 0.4.2 - Fix .remove() method to remove a single file in a directory (@kaelzhang). Fixing Cannot call method 'call' of undefined (@krasimir). Track new file additions within folders (@brett-shwom). | ||
* 0.4.1 - Fix watchDir not respecting close in race condition (@chrisirhc). | ||
* 0.4.0 - Drop support for node v0.6. Use globule for file matching. Avoid node v0.10 path.resolve/join errors. Register new files when added to non-existent folder. Multiple instances can now poll the same files (@jpommerening). | ||
* 0.3.4 - Code clean up. Fix path must be strings errors (@groner). Fix incorrect added events (@groner). | ||
* 0.4.2 - Fix `.remove()` method to remove a single file in a directory (@kaelzhang). Fixing “`Cannot call method 'call' of undefined`” (@krasimir). Track new file additions within folders (@brett-shwom). | ||
* 0.4.1 - Fix `watchDir` not respecting close in race condition (@chrisirhc). | ||
* 0.4.0 - Drop support for Node.js v0.6. Use `globule` for file matching. Avoid Node.js v0.10 `path.resolve`/`join` errors. Register new files when added to non-existent folder. Multiple instances can now poll the same files (@jpommerening). | ||
* 0.3.4 - Code clean up. Fix “`path must be strings`” errors (@groner). Fix incorrect `added` events (@groner). | ||
* 0.3.3 - Fix for multiple patterns with negate. | ||
* 0.3.2 - Emit `end` before removeAllListeners. | ||
* 0.3.1 - Fix added events within subfolder patterns. | ||
* 0.3.2 - Emit `end` before `removeAllListeners`. | ||
* 0.3.1 - Fix `added` events within subfolder patterns. | ||
* 0.3.0 - Handle safewrite events, `forceWatchMethod` option removed, bug fixes and watch optimizations (@rgaskill). | ||
* 0.2.2 - Fix issue where subsequent add calls dont get watched (@samcday). removeAllListeners on close. | ||
* 0.2.2 - Fix issue where subsequent `add` calls dont get watched (@samcday). `removeAllListeners` on `close`. | ||
* 0.2.1 - Fix issue with invalid `added` events in current working dir. | ||
* 0.2.0 - Support and mark folders with `path.sep`. Add `forceWatchMethod` option. Support `renamed` events. | ||
* 0.1.6 - Recognize the `cwd` option properly | ||
* 0.1.5 - Catch too many open file errors | ||
* 0.1.5 - Catch “`too many open file`” errors | ||
* 0.1.4 - Really fix the race condition with 2 watches | ||
@@ -201,3 +202,3 @@ * 0.1.3 - Fix race condition with 2 watches | ||
## License | ||
Copyright (c) 2015 Kyle Robinson Young | ||
Copyright (c) 2018 Kyle Robinson Young | ||
Licensed under the MIT license. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25850
486
197