Do esm.sh and jspm.org follow the same approach regarding deno compatibility?

381 Views Asked by At

I've seen deno examples importing npm modules both from esm.sh and jspm.org

In esm.sh I read:

  • esm.sh will polyfill the node internal modules(fs,os,etc) with https://deno.land/std/node to support some modules to work in Deno, like postcss
  • By default, esm.sh will response a custom HTTP header of X-TypeScript-Types when the types(dts) defined, that is useful for deno types check

Does jspm.org follow the same approach?

Which one is less likely to cause issues when importing npm modules in deno?

1

There are 1 best solutions below

0
Steven Guerrero On

No, JSPM is in fact adding browser compatibility polyfills. It's thought for a more general usability across JavaScript ecosystems, so Deno isn't a primary target for them, while it is definitely for ESM.SH