Hacker News new | ask | show | jobs
by Kiro 1625 days ago
I prefer CommonJS. It's so simple. You assign the dependency to a variable and that's it. I still need to look up the syntax every time I use ESM.
2 comments

> You assign the dependency to a variable and that's it

erm, how is that any simpler than `export const/function/class $defintion` ?

I guess if you only touch JS once in a blue moon it's difficult to remember?

Also CommonJS has some acknowledged issues around cyclic dependencies, and being incredibly fudgeable at runtime that makes static analysis and linting a pain.

it is simple to write, it is not simple at all how strings are converted into paths.

honestly tough, esm is more complex than it should (especially regarding how live exports happen)