Deno has the ability to consume ES modules. Thanks to this, we can utilize Pika’s Skypack CDN to install and run any of our favorite NPM packages on the CDN that support ES modules!

Installing a module

In our example, we are going to install and run a short XState example in Deno. I will write more on XState in future posts, but for now we are using this as an example of “picking an ESM module from Skypack CDN and getting it going”.

First, head to the Skypack CDN website and search for your favourite NPM package to see if the corresponding ES module is available.

Searching XState on the Skypack CDN website

#typescript #xstate #deno #npm

How to use NPM ES Modules with Deno
5.70 GEEK