Hacker News new | past | comments | ask | show | jobs | submit login

Jarred says it best: 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(…)`




ESM 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: