DEV Community

Discussion on: 3 ways to import node modules in deno

Collapse
yendenikhil profile image
Nik

Good one.

Don’t forget esm.sh (an esm shiv)

Collapse
canrau profile image
Can Rau • Edited on

Yes, this 👌 and skypack.dev some modules only work on one not the other for me so if one fails it's worth trying the other one 🤓

Also there's "denoify" and the new --compat flag as mentioned on Twitter

Collapse
siddharthshyniben profile image
Siddharth Author

Yes, I came over the --compat flag but that's for running apps which are written in Common JS, not for importing modules.

And skypack didn't work for most modules for me, so I didn't include it.

Never heard of denoify though, I have to check it out!

Thread Thread
canrau profile image
Can Rau • Edited on

Interesting, I mainly switch between esm.sh and skypack.dev usually one of them works.
Never tried jspm so far 👀

Also esm.sh and skypack.dev support Typescript headers for Deno 🤓

Thread Thread
siddharthshyniben profile image
Siddharth Author

Ah, that's cool! I should check that out.

Collapse
siddharthshyniben profile image
Siddharth Author

Ah I didn't know about that. Thanks for mentioning!