Node Modules at War: Why CommonJS and ES Modules Can’t Get Along

By Dan Fabulich.

View original

Excerpt: In Node 14, there are now two kinds of scripts: there are old-style CommonJS (CJS) scripts and new-style ESM scripts (aka MJS). CJS scripts use require() and module.exports; ESM scripts use import…