Replace fs-extra's re-exported fs methods with node:fs
Proprietaryfs-extra re-exports every fs method, with the async ones returning a promise when no callback is passed. Promise-form calls move to node:fs/promises; callback-form calls, *Sync methods, streams, watchers and constants move to node:fs. fd-based methods, open and glob keep their promise form on fs-extra, as node:fs/promises has no fd-number equivalents and its open and glob resolve to a FileHandle and an async iterator rather than an fd and an array. Whether a call passes a callback is read from its last argument's type, so a call whose last argument may or may not be a function (any, untyped JavaScript, a union of both, a named type alias) is left on fs-extra.
org. openrewrite. node. migrate. fs-extra. replace-fs-extra-native-methodsmod run . --recipe= org. openrewrite. node. migrate. fs-extra. replace-fs-extra-native-methodsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.