fs: support BigInt in fs.*stat and fs.watchFile
- fs: support BigInt in fs.*stat and fs.watchFile
Add the
bigint: true
option to all thefs.*stat
methods andfs.watchFile
. - doc: document BigInt support in fs.Stats
I chose to expose the BigInt variant via bigint: true
in the option object because right now there are no support of a Date class with higher precision - the old Date is Number-based and can lose precision when being constructed out of a 64bit ms value. The plan is that when JS does get a better Date e.g. Temporal (see https://github.com/tc39/proposal-bigint/issues/136), we will be able to support temporal: true
.
The --harmony-bigint
flag is necessary until v8 6.7 lands.
Fixes: https://github.com/nodejs/node/issues/12115
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines