Closed FreePhoenix888 closed 9 months ago
In CJS mode, we're exporting wrapped versions of graceful-fs which support either callbacks or promises. We can't do this in ESM, since exports are static. See https://github.com/jprichardson/node-fs-extra/issues/746 for detailed discussion.
We could export * from 'fs/promises'
, but that wouldn't cover native sync methods, which would be confusing, because you'd have to import native sync methods from fs
, but fs-extra/esm
exports both sync and async methods. Also, this would be inconsistent with the CJS version, since the CJS version exports graceful-fs, not fs.
fs-extra
version:Export fs/promises function for esm like you do for cjs