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.

PR-URL: #40134
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
clement-nardi authored and targos committed Oct 4, 2021
1 parent a660017 commit 9a2b94a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/fs.md
Expand Up @@ -3847,7 +3847,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 9a2b94a

Please sign in to comment.