Skip to content

Commit d5fa1d5

Browse files
seishunaddaleax
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 3014dfd commit d5fa1d5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/fs.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,12 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i
17011701
`'rename'` or `'change'`, and `filename` is the name of the file which triggered
17021702
the event.
17031703

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

17071711
### Caveats
17081712

0 commit comments

Comments
 (0)