diff options
author | cjihrig <cjihrig@gmail.com> | 2020-03-06 12:00:43 -0500 |
---|---|---|
committer | Richard Lau <riclau@uk.ibm.com> | 2020-07-01 12:23:41 -0400 |
commit | 193d1d0e84132a84f509996607c94ef6bfe85a63 (patch) | |
tree | c1b34ff7bfe378616b33540e6e8506245b21043b | |
parent | 74b00cca64e480a74bf1792576db46ef31824f2f (diff) | |
download | node-new-193d1d0e84132a84f509996607c94ef6bfe85a63.tar.gz |
doc: document fs.watchFile() bigint option
This commit documents the bigint option to fs.watchFile(), which
has been supported since v10.5.0.
PR-URL: https://github.com/nodejs/node/pull/32128
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
-rw-r--r-- | doc/api/fs.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 2fc237675b..13690f6767 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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 @@ -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} @@ -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`. |