esm: provide named exports for builtin libs by devsnek · Pull Request #20403 · nodejs/node
provide named exports for all builtin libraries so that the libraries may be
imported in a nicer way for esm users: import { readFile } from 'fs'
instead of importing the entire namespace, import fs from 'fs', and
calling fs.readFile. the default export is left as the entire
namespace (module.exports)
continuation of #18131 because it got too long and github was giving unicorns
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