Skip to content

Commit

Permalink
doc: update fs.watchFile doc
Browse files Browse the repository at this point in the history
The current wording suggests to compare Date objects, which won't work.
  • Loading branch information
clement-nardi committed Sep 20, 2021
1 parent 4e7fe5a commit b65821f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3903,7 +3903,7 @@ These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
the numeric values in these objects are specified as `BigInt`s.
To be notified when the file was modified, not just accessed, it is necessary
to compare `curr.mtime` and `prev.mtime`.
to compare `curr.mtimeMs` and `prev.mtimeMs`.
When an `fs.watchFile` operation results in an `ENOENT` error, it
will invoke the listener once, with all the fields zeroed (or, for dates, the
Expand Down

0 comments on commit b65821f

Please sign in to comment.