Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The module standard that is present in ES6 is a very different beast than CommonJS


Agreed. I use ES6 modules regularly (via Babel compiled to CommonJS, and also Rollup). Unlike CommonJS, ES6 modules have the advantage (and disadvantage) of being statically resolved, which permits tree-shaking (but denies dynamic resolution of imports like CommonJS).

The "that" in my sentence refers to "module system", not "CommonJS", but I agree my sentence was unclear.


More specifically: in the next major Node.js release (v7.0.0), ES6 modules will be implemented. That's what I was trying to say.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: