Complete guide to creating Node.js packages with ES6 modules that are easily usable from CJS modules
Published in
22 min readApr 28, 2021
It is very tempting to write all JavaScript code on Node.js with ES6 modules. But that creates a problem of interoperability with a large number of existing CommonJS (CJS) modules. Namely, it is difficult to use ES6 modules from a CJS module. Node.js makes it easy to use both CJS and ES6 modules from an ES6 module, and…