es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
405 stars 2 forks source link

Removing fs-extra from packages with async node:fs support #33

Open jordanfinners opened 8 months ago

jordanfinners commented 8 months ago

In newer versions of Node, theres a promises API for the file system which has a lot of overlap with https://www.npmjs.com/package/fs-extra

43081j commented 8 months ago

this will be a big one.

thankfully, fs-extra isn't bloated but you are right it could be removed entirely from many projects

we will have to look up the engines constraint of popular packages depending on it, and remove fs-extra if they're on a node version which ships async fs

psulek commented 5 months ago

Be aware that fs-extra is not just polyfill, it adds extra functionality like emptyDir, and so which does not have direct replacement, but of course can be replaced with similar code as fs-extra.

43081j commented 5 months ago

you're right

its a pretty useful package for sure. we should only really move projects away from it for the stuff that has native equivalents in their supported node versions (e.g. recursive readdir, async methods, etc)