4 ms·
You can import npm packages using esm and skypack. import React from "https://esm.sh/react@17.0.2 https://esm.sh/react@17.0.2" should work. For skypack, add ?
by searchableguy 6y ago
You can import npm packages using esm and skypack.
import React from "https://esm.sh/react@17.0.2 https://esm.sh/react@17.0.2" should work.
For skypack, add ?dts flag at the end to get typescript typing support automatically.
Self hosting is an option too with above.
if you want more npm modules to work with deno, you can contribute to https://deno.land/std/node https://deno.land/std/node
- nikisweeting 6y agoThis is good, but even with integrity hashes it makes me slightly uncomfortable to have a (relatively unknown) SaaS company stand between the original source on npm and us. Self-hosting seems good, but how does one do that? I didn't see any docs on Skypack's site about self-hosting something that would work as a npm-to-deno-repackaging server.
- searchableguy 6y agoSorry, I was talking about esm.sh https://github.com/postui/esm.sh https://github.com/postui/esm.sh This is written in golang and can be self hosted. > This is good, but even with integrity hashes it makes me slightly uncomfortable to have a (relatively unknown) SaaS company stand between the original source on npm and us. I understand the worries but npm is a private SAAS company which was unknown at the time of node too. Things take time to sort out and become stable. Unlike node, where npm defaults to npmjs - a private company which can go anytime. Deno doesn't make that choice for users. I believe that is the right step. Trust what you need to and have an allow list.