From 9eb700c6348c0eddc2f3594be3460c31626a112b Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Thu, 20 Nov 2025 12:30:49 +0800 Subject: [PATCH 1/2] fs: add `Temporal.Instant` support to `Stats` and `BigIntStats` --- doc/api/fs.md | 37 +++++++- lib/internal/fs/utils.js | 130 +++++++++++++++++++++++++++-- test/parallel/test-fs-watchfile.js | 12 ++- 3 files changed, 162 insertions(+), 17 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index f09395cb123150..3f246210de04e0 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4494,7 +4494,11 @@ Stats { atime: 2019-06-22T03:37:33.072Z, mtime: 2019-06-22T03:36:54.583Z, ctime: 2019-06-22T03:37:06.624Z, - birthtime: 2019-06-22T03:28:46.937Z + birthtime: 2019-06-22T03:28:46.937Z, + atimeInstant: 2019-06-22T03:37:33.071963Z, + mtimeInstant: 2019-06-22T03:36:54.5833518Z, + ctimeInstant: 2019-06-22T03:37:06.6235366Z, + birthtimeInstant: 2019-06-22T03:28:46.9372893Z } false Stats { @@ -4515,7 +4519,11 @@ Stats { atime: 2019-06-22T03:36:56.619Z, mtime: 2019-06-22T03:36:54.584Z, ctime: 2019-06-22T03:36:54.584Z, - birthtime: 2019-06-22T03:26:47.711Z + birthtime: 2019-06-22T03:26:47.711Z, + atimeInstant: 2019-06-22T03:36:56.6188555Z, + mtimeInstant: 2019-06-22T03:36:54.584Z, + ctimeInstant: 2019-06-22T03:36:54.5838145Z, + birthtimeInstant: 2019-06-22T03:26:47.7107478Z } ``` @@ -7203,6 +7211,9 @@ i.e. before the `'ready'` event is emitted.