Problem
The project uses CommonJS require() throughout 40+ source files. Modern Node.js 20+ has stable ESM support and many dependencies are moving ESM-only.
Proposed Solution
- Add
"type": "module" to package.json
- Convert
require() calls to import statements
- Convert
module.exports to export statements
- Update Jest config to support ESM (or migrate to Vitest)
- This is a larger refactor — could be done incrementally per directory
Problem
The project uses CommonJS
require()throughout 40+ source files. Modern Node.js 20+ has stable ESM support and many dependencies are moving ESM-only.Proposed Solution
"type": "module"topackage.jsonrequire()calls toimportstatementsmodule.exportstoexportstatements