UNPKG

UNPKG is a fast, global content delivery network for everything on npm. Use it to quickly and easily load any file on npm using a URL like:

unpkg.com/:pkg@:ver/:file

  • :pkg is the name of the package on npm
  • :ver is the version of the package
  • :file is the path to a file in the package

For example:

You can also use any valid semver range or npm tag:

If you don't specify a version, the latest tag is used by default.

Add a trailing / to a directory URL to view a listing of all the files in that directory.

If you'd like to browse an older version of a package, include a version number in the URL.

If you don't specify a file path, UNPKG will resolve the file based on the package's default entry point. In many packages that are meant solely for frontend development, like jQuery and GSAP, this will be the value of the main field in the package.json file.

In modern packages that use the exports field, UNPKG will resolve the file using the default export condition.

So, for example if you publish a package with the following package.json:

{ "name": "my-package", "exports": { "default": "./dist/index.js" } }

You would be able to load your package from UNPKG using a