News for hackers. Stuff that matters.
Re:Today’s JavaScript, from an outsider’s perspective (2020) by throw_m239339 on Friday May 27, 2022 @03:00AM (#31526776)
> This isn't rocket science and honestly makes perfect sense.

it only makes sense if you understand all the differences between ES modules and node modules that exists purely for historical reasons. Node modules are not part of ES specification at first place.

Re:Today’s JavaScript, from an outsider’s perspective (2020) by goldenkey on Friday May 27, 2022 @03:09AM (#31526828)
The module stuff is a different story and that's its own rabbit hole. I don't think its the crux of the blog post or even my comment. The purported issue was that changing the package.json type to module didn't fix things. That expectation is beyond amateur and I don't think there's really anything to complain about if one expects to bootstrap into a new programming language with package management, without understanding the general paradigm.
Re:Today’s JavaScript, from an outsider’s perspective (2020) by MaxLeiter on Friday May 27, 2022 @03:22AM (#31526910)
Well, they expected it because it's what node told them to do.

from the article:

John runs node index.js

Node:

Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.