nodejs / nodejs/userland-migrations
CJS → ESM
Open
@AugustinMauroy is already working on this.
Since Jan 22, 2026.
- Dominant language
- TypeScript
- Stars
- 85
- Forks
- 55
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 9
Description
Technical Design
Create a wrapper migration to orchestrate individual sub-migrations (eg inline require()s → await import() or import.sync() depending on parent context being sync or async).
This wrapper should handle:
- Running individual API migrations
- Update files using CJS-specific extension (
.cjs→.mjs, etc). - Update
package.json("type": "commonjs"→"type": "module", etc).
I think we can release a 0.1.0 version with a subset:
- https://github.com/nodejs/userland-migrations/issues/342 (without the file extension changer)
- https://github.com/nodejs/userland-migrations/issues/344
- Complete API migrations for
- Incomplete API migrations with detection + logging for all other API migrations
[!IMPORTANT]
Each sub-task should have its own PR
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.