News for hackers. Stuff that matters.
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by e12e on Thursday August 06, 2020 @04:10AM (#24069028)
Meanwhile, I found this on how Deno handles modules (it's all esm):

https://www.sitepoint.com/deno-module-system-a-beginners-gui...

Note that - if you can get an esm out of your cjs - and it doesn't use any nodejs apis unsupported by deno, then you might be able to use it:

> (...) Several CDNs can convert npm/CommonJS packages to ES2015 module URLs, including: Skypack.dev, jspm.org, unpkg.com (add a ?module querystring to a URL)

Ed: submitted as: https://news.ycombinator.com/item?id=24069037 since I couldn't find an earlier submission, and maybe it'll generate some interesting discussion on deno / modern js vs node.

In particular I wonder if it'll in practice be easier to share (more) code between backend and front-end.

Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by e12e on Thursday August 06, 2020 @04:24AM (#24069099)
There's also a crutch - I'm not sure how attractive it would be in a project using deno, though. Maybe to get up and running quickly on deno when moving a legacy project from nodejs?

https://deno.land/[email protected]/node#commonjs-module-loading

Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by dane-pgp on Thursday August 06, 2020 @10:26AM (#24071158)
> (it's all esm)

Always has been.