mk-pmb / mjs2cjs-pmb-js

Rewrite `import` and `export` statements to `require()` and `module.exports`.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mjs2cjs-pmb

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.

Usage

$ mjs2cjs-pmb *.mjs
E: Stub!
$ mjs2cjs-pmb --autofind
E: Stub!

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

Rewrite `import` and `export` statements to `require()` and `module.exports`.


Languages

Language:Shell 100.0%