You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you are misunderstanding the situation/documentation, which is understandable because both the situation and the documentation are a little confusing.
If I recall correctly, there is no rename event on FSWatcher. However, the callback to fs.watch() (that's a link to the relevant part of the doc right there, which may be worth following along with) receives a string (not an event, but confusingly called event in the doc) and that string can be either 'change' or 'rename'. However those are not events. Those are merely strings describing the type of (get ready to be confused) change event that was fired under the hood.
At least that's my understanding/recollection. Correction welcome. And if I'm not wrong, a pull request that made the docs easier to understand would also be welcome.
Activity
Trott commentedon Jul 1, 2016
I think you are misunderstanding the situation/documentation, which is understandable because both the situation and the documentation are a little confusing.
If I recall correctly, there is no
renameevent onFSWatcher. However, the callback tofs.watch()(that's a link to the relevant part of the doc right there, which may be worth following along with) receives a string (not an event, but confusingly calledeventin the doc) and that string can be either'change'or'rename'. However those are not events. Those are merely strings describing the type of (get ready to be confused)changeevent that was fired under the hood.At least that's my understanding/recollection. Correction welcome. And if I'm not wrong, a pull request that made the docs easier to understand would also be welcome.
/cc @nodejs/documentation
cpojer commentedon Jul 1, 2016
You are right, I was jumping from fs.watch to fs.FSWatcher in the docs and missed this.
claudiorodriguez commentedon Jul 1, 2016
Made a PR but I'd appreciate feedback on whether it actually clarifies the issue.
fs: rename event to eventType in fs.watch listener
fs: rename event to eventType in fs.watch listener
fs: rename event to eventType in fs.watch listener
fs: rename event to eventType in fs.watch listener