fs: refactor fs module
Fairly sizable structural refactoring of the fs
module. It moves several pieces out into separate submodules that are lazy-loaded, switches the use the module.exports = {}
pattern in a way that preserves the ability to monkeypatch, and uses const
/let
more consistently.
The changes are intended to be squashed down into a single commit when landing but are separated out for easier review.
https://github.com/nodejs/node/pull/20735 should likely land first.
defensively semver-major. CITGM looks good, graceful-fs still appears to work as expected... so this can be semver-patch. woohoo!
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines