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
{{ message }}
Repository navigation
Explore fast path: fs.isFile and fs.isDirectory #46
Module resolution typically involves a lot of file system calls. During the performance meeting on 23. Jan 2023 the idea was voiced to explore how much speedup could be gained via an optimized isFile or isDirectory function.
Example npm packages where such functions are used in the wild:
Activity
anonrig commentedon Jan 23, 2023
Question: What would you expect
fs.isFileto return on a non-existing path?marvinhagemeister commentedon Jan 23, 2023
I'd expect it to return
false.Found an
isFilefunction in node itself that is used during ESM resolution. Looks like node would benefit from a dedicatedisFilefunction too.https://github.com/nodejs/node/blob/762a3a8ad925d56a12b43e0e7f7c811e93097784/lib/internal/modules/esm/resolve.js#L149-L151
fs: add isFile and isDirectory methods