Skip to content

Commit

Permalink
Add notes about relative/watched being sync in v0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Oct 25, 2015
1 parent 4f120df commit f567c1d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ gaze('**/*.js', function(err, watcher) {
console.log(watched);
});

// Or if using <= v0.5.2
var watched = this.watched();

// On file changed
this.on('changed', function(filepath) {
console.log(filepath + ' was changed');
Expand All @@ -58,6 +61,9 @@ gaze('**/*.js', function(err, watcher) {
this.relative(function(err, files) {
console.log(files);
});

// Or if using <= v0.5.2
var files = this.relative();
});

// Also accepts an array of patterns
Expand Down Expand Up @@ -166,6 +172,8 @@ var gaze = new Gaze(pattern, options, callback);
* `unixify` {boolean} Return paths with `/` instead of `\\` if on Windows.
* `callback` {function} Calls with `function(err, files)`.

> Note: Gaze <= 0.5.2 both relative() and watched() are sync and don't use callbacks.
## Similar Projects

Other great watch libraries to try are:
Expand Down

0 comments on commit f567c1d

Please sign in to comment.