Open
Description
ESM is the way to handle cross-file relationships. Plus, it's built into the language.
Node.js' internals still use require
, meaning new contributors need to learn about CJS and all of the changes it brings.
Moving from CJS to ESM internally comes with numerous benefits:
- The syntax is immediately recognizable to new contributors
- JS boilerplate is eliminated, increasing performance
- Module-only features can be used (e.g. top-level
await
)
For lib/internal
, import specifiers are open to bikeshedding but I think either using node:internal/...
or internal:
would work nicely.
This is a significant amount of work, and I'd appreciate some feedback before I pour dozens of hours into it.
Also, I imagine that Node.js would move away from CJS completely in the future (though this is just my opinion).
Metadata
Metadata
Assignees
Labels
No labels