Skip to content

Commit 5ef7180

Browse files
seishunMylesBorins
authored andcommitted
doc: clarify eventType in fs.watch
'rename' is confusing, and it's not clear what "they" refers to. Fixes: #9082 PR-URL: #9318 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent d456147 commit 5ef7180

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/fs.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,8 +1703,12 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i
17031703
`'rename'` or `'change'`, and `filename` is the name of the file which triggered
17041704
the event.
17051705

1706-
Please note the listener callback is attached to the `'change'` event
1707-
fired by [`fs.FSWatcher`][], but they are not the same thing.
1706+
Note that on most platforms, `'rename'` is emitted whenever a filename appears
1707+
or disappears in the directory.
1708+
1709+
Also note the listener callback is attached to the `'change'` event fired by
1710+
[`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of
1711+
`eventType`.
17081712

17091713
### Caveats
17101714

0 commit comments

Comments
 (0)