2 ms·
Jarred says it best: https://bun.sh/blog/commonjs-is-not-going-away https://bun.sh/blog/commonjs-is-not-going-away - 75% of NPM is CommonJS - It’s better for
by jitl 3y ago
Jarred says it best: https://bun.sh/blog/commonjs-is-not-going-away https://bun.sh/blog/commonjs-is-not-going-away
- 75% of NPM is CommonJS
- It’s better for lazy loading / cold start outside the browser than `await import(…)`
- Jarred 3y agoESM has nice things too, like top-level-await and strict mode by default. Explicit imports/exports are better for autocomplete when TS is unavailable. I think the ESM slowness can eventually be compensated for but it will need spec changes. Possibly the defer import proposal. But yeah, CommonJS is basically never going away.