Re:NPM and NodeJS should do more to make ES Modules easy to use
by recursive on Thursday June 20, 2024 @07:15PM
(#40744533)
The browsers would never implement it.
[ Parent
| on HN ]
Re:NPM and NodeJS should do more to make ES Modules easy to use
by efilife on Friday June 21, 2024 @03:52AM
(#40747180)
This is not a talk about browsers, hence the readFileSync examples
Re:NPM and NodeJS should do more to make ES Modules easy to use
by recursive on Friday June 21, 2024 @12:34PM
(#40751216)
The reason we got here in the first place was trying to standardize the language and its module loading. If you come up with a solution that doesn't work in browsers, we're back to the same thing. Instead of the `require()` polyfill, we'd need the `importSync` polyfill.
Re:NPM and NodeJS should do more to make ES Modules easy to use
by tqwhite on Friday June 21, 2024 @11:34AM
(#40750667)
Nor do they have require(). That’s not the point.
Re:NPM and NodeJS should do more to make ES Modules easy to use
by recursive on Friday June 21, 2024 @12:27PM
(#40751154)
And the fact that require() is non-standard is why we're talking about ESM now. Node can cook up another non-standard package loading thing whenever they want. It just won't be ESM. And if you don't care what browsers do, then we're not talking about ESM.