Skip to content

Commit 74cbc36

Browse files
committed
Update docs.
1 parent ccf759a commit 74cbc36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ var watchedPaths = watcher.getWatched();
117117
watcher.unwatch('new-file*');
118118

119119
// Stop watching.
120-
watcher.close();
120+
// The method is async!
121+
watcher.close().then(() => console.log('closed'));
121122

122123
// Full list of options. See below for descriptions.
123124
// Do not use this example!
@@ -254,7 +255,7 @@ Additionally `all` is available which gets emitted with the underlying event
254255
name and path for every event other than `ready`, `raw`, and `error`. `raw` is internal, use it carefully.
255256
* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns.
256257
Takes an array of strings or just one string.
257-
* `.close()`: Removes all listeners from watched files.
258+
* `.close()`: Removes all listeners from watched files. Asynchronous, returns Promise.
258259
* `.getWatched()`: Returns an object representing all the paths on the file
259260
system being watched by this `FSWatcher` instance. The object's keys are all the
260261
directories (using absolute paths unless the `cwd` option was used), and the

0 commit comments

Comments
 (0)