Skip to content

Commit

Permalink
doc: document fs.watchFile() bigint option
Browse files Browse the repository at this point in the history
This commit documents the bigint option to fs.watchFile(), which
has been supported since v10.5.0.

PR-URL: #32128
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
cjihrig authored and richardlau committed Jul 1, 2020
1 parent 74b00cc commit 193d1d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3369,6 +3369,9 @@ fs.watch('somedir', (eventType, filename) => {
<!-- YAML
added: v0.1.31
changes:
- version: v10.5.0
pr-url: https://github.com/nodejs/node/pull/20220
description: The `bigint` option is now supported.
- version: v7.6.0
pr-url: https://github.com/nodejs/node/pull/10739
description: The `filename` parameter can be a WHATWG `URL` object using
Expand All @@ -3377,6 +3380,7 @@ changes:

* `filename` {string|Buffer|URL}
* `options` {Object}
* `bigint` {boolean} **Default:** `false`
* `persistent` {boolean} **Default:** `true`
* `interval` {integer} **Default:** `5007`
* `listener` {Function}
Expand All @@ -3402,7 +3406,8 @@ fs.watchFile('message.text', (curr, prev) => {
});
```

These stat objects are instances of `fs.Stat`.
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`.
Expand Down

0 comments on commit 193d1d0

Please sign in to comment.