esm2cjs
Command line utility to compile a JS project from ES modules to CommonJS. This is handy when building hybrid ESM/CommonJS npm packages.
Built on top of the blazing fast esbuild and supports all modern JS features.
Install (globally)
npm i -g @alcalzone/esm2cjs
yarn add --global @alcalzone/esm2cjs
Usage
esm2cjs --in path/to/input --out path/to/output [options]
Detailed help is shown on the command line using
esm2cjs --help
Performance
No. of input files | total size | time taken |
---|
141 | 987 KB | 390 ms |
Changelog
1.1.0 (2021-06-19)
- Support specifying output target and platform
1.0.0 (2021-06-16)
Initial release