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
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.