You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Temporal proposal is currently Stage 3, has in progress / experimental implementation in V8 (available in latest releases using --harmony-temporal), and is likely to be unflagged in Node.js once it's stable enough (refs: #57127, #57128).
In light of this, I propose that Node.js begins supporting Temporal in the relevant APIs (mainly those that already work with Dates) after it becomes available by default without runtime flag.
Relevant APIs:
fs: Stats and BigIntStats
Only bigint version provides nanosecond precision, and both provide lazy getters for Date instances. Adding lazy getters for Temporal.Instant would also make non-bigint version provide nanosecond precision.
fs: utimes(), lutimes(), futimes(), utimesSync(), lutimesSync(), futimesSync(), promises.utimes(), promises.lutimes(), filehandle.utimes()
Accepts atime and mtime as number|string|Date, can support Temporal.Instant as well.
Note: these functions also don't accept bigints yet. In the Temporal API, numbers are used for epochTimes in milliseconds while bigints are used for nanoseconds. Adding direct support of bigints might result a confusing API: some users might expect it to coerce type and behave exactly the same as number|string, some might expect it to be parsed as nanoseconds. Adding Temporal support would make it unambiguous.
Maybe there are other APIs that can benefit from this, too?
cc @nodejs/fs since it's only
fsIssues and PRs related to the fs subsystem / file system.
at the moment.
Internal updates (if it happens to be more precise, more fast, or more readable), generic support (primordials, util, assert, etc.) and dependencies (for example, undici.setCookie(, { expires })) are out of scope here.
The
Temporalproposal is currently Stage 3, hasin progress / experimentalimplementation in V8 (available in latest releases using--harmony-temporal), and is likely to be unflagged in Node.js once it's stable enough (refs: #57127, #57128).In light of this, I propose that Node.js begins supporting
Temporalin the relevant APIs (mainly those that already work withDates) after it becomes available by default without runtime flag.Relevant APIs:
fs:StatsandBigIntStatsOnly bigint version provides nanosecond precision, and both provide lazy getters for
Dateinstances. Adding lazy getters forTemporal.Instantwould also make non-bigint version provide nanosecond precision.fs:utimes(),lutimes(),futimes(),utimesSync(),lutimesSync(),futimesSync(),promises.utimes(),promises.lutimes(),filehandle.utimes()Accepts
atimeandmtimeasnumber|string|Date, can supportTemporal.Instantas well.Note: these functions also don't accept
bigints yet. In the Temporal API,numbers are used forepochTimes in milliseconds whilebigints are used for nanoseconds. Adding direct support ofbigints might result a confusing API: some users might expect it to coerce type and behave exactly the same asnumber|string, some might expect it to be parsed as nanoseconds. AddingTemporalsupport would make it unambiguous.Maybe there are other APIs that can benefit from this, too?Issues and PRs related to the fs subsystem / file system.
at the moment.
cc @nodejs/fs since it's only fs
Internal updates (if it happens to be more precise, more fast, or more readable), generic support (primordials,
util,assert, etc.) and dependencies (for example,undici.setCookie(, { expires })) are out of scope here.