Skip to content

Commit

Permalink
doc: clarify eventType in fs.watch
Browse files Browse the repository at this point in the history
'rename' is confusing, and it's not clear what "they" refers to.

Fixes: #9082
PR-URL: #9318
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
seishun authored and silverwind committed Nov 15, 2016
1 parent 4d55d16 commit b209a6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1701,8 +1701,12 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i
`'rename'` or `'change'`, and `filename` is the name of the file which triggered
the event.

Please note the listener callback is attached to the `'change'` event
fired by [`fs.FSWatcher`][], but they are not the same thing.
Note that on most platforms, `'rename'` is emitted whenever a filename appears
or disappears in the directory.

Also note the listener callback is attached to the `'change'` event fired by
[`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of
`eventType`.

### Caveats

Expand Down

0 comments on commit b209a6e

Please sign in to comment.