Rewrite import
and export
statements to require()
and module.exports
.
Usually, the esm module works great, especially with esmod-pmb and nodemjs. However, sometimes you may encounter a project where the planets align so badly it's not feasible to use them. So you bow to Urdr (Norn of the past) and repackage an entire project.
Fortunately you were wise enough to code in a style where translating between MJS and CJS is a mere text replacement chore, so this tool can do it.
$ mjs2cjs-pmb *.mjs
E: Stub!
$ mjs2cjs-pmb --autofind
E: Stub!
- Needs more/better tests and docs.
ISC