Using NPM as a CDN


We just published @fireflysemantics/fs-gist .

We want to use NPM as a CDN such that we can declare fs-gist in a script tag.


We will use UNPKG:

We simply declare our script tag like this:

<script src=""></script>

Generally the format for the domain, host, and fragment parts of the URL is:

In our case we did not specify version and we left out the file, since we will be using what is specified in the main attribute of package.json.

Related Concepts



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ole Ersoy

Ole Ersoy

Founder of Firefly Semantics Corporation