News for hackers. Stuff that matters.
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by WorldMaker on Thursday August 06, 2020 @04:09PM (#24074922)
It is possible, but you have to hack the Node require() loader to do it, teach it a lot about ESM loading, and then hope the downstream CJS don't have timing bugs around "very long" synchronous require() loads.

https://github.com/standard-things/esm

Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by jkrems on Thursday August 06, 2020 @08:31PM (#24076823)
I'm not sure that's really relevant here because esm is just one of the transpilers for module syntax, it's not running native modules at all. The same can be achieved with the babel CLI or TSC etc. and the right configuration. But it's not really "ESM loading". It's compiling ESM to CJS and then running CJS. It's true that transpiling to CJS will continue to work, no matter what.
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by WorldMaker on Friday August 07, 2020 @12:06PM (#24083414)
To my understanding this ESM module uses native ESM loading on Node versions that support it, which is why others point out its behavior with top-level await is deficient in the same ways that Node's own behavior is, though it tries.