Skip to content

Commit

Permalink
Document unwatch method
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Jan 20, 2015
1 parent 6a231f0 commit 90914f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -67,6 +67,8 @@ watcher.on('change', function(path, stats) {
watcher.add('new-file');
watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);

watcher.unwatch('new-file*');

// Only needed if watching is persistent.
watcher.close();

Expand Down Expand Up @@ -124,6 +126,8 @@ Takes an array of strings or just one string.
Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`, `raw`, `error`.
Additionally `all` is available which gets emitted with the underlying event name
and path for every event other than `ready`, `raw`, and `error`.
* `.unwatch(path /paths)`: Stop watching files, directories, or glob patterns.
Takes an array of strings or just one string.
* `.close()`: Removes all listeners from watched files.

## License
Expand Down

0 comments on commit 90914f5

Please sign in to comment.