Go to file
Michael Jackson a8471ed950 Sort keys in createSearch + add tests 2018-05-25 20:22:59 -04:00
client Update README 2018-04-28 19:09:15 -07:00
docs Update README 2018-04-28 19:09:15 -07:00
public Better dev server integration 2018-02-16 16:00:06 -08:00
scripts Prettify everything 2018-02-17 20:23:05 -08:00
server Sort keys in createSearch + add tests 2018-05-25 20:22:59 -04:00
.gitignore Better dev server integration 2018-02-16 16:00:06 -08:00
.nvmrc Use node 8.4.x in production, 8.4.0 on Travis 2017-11-11 20:43:44 -08:00
.travis.yml Use node 8.4.x in production, 8.4.0 on Travis 2017-11-11 20:43:44 -08:00
Procfile Rename logs worker 2017-08-22 17:22:19 -07:00
Procfile.dev Rename process type 2018-02-26 20:07:32 -08:00
README.md Link to website in README 2018-04-28 19:17:01 -07:00
package.json Upgrade tar-fs to 1.16.2 2018-05-22 22:24:26 -04:00
public.key Add auth and blacklist APIs 2017-11-11 12:18:13 -08:00
server.js Add server config, move plugin file 2018-05-17 10:10:33 -07:00
unpkg.sketch Move design file into repo root 2018-02-16 09:52:53 -08:00
webpack.config.js Better dev server integration 2018-02-16 16:00:06 -08:00
yarn.lock Upgrade tar-fs to 1.16.2 2018-05-22 22:24:26 -04:00

README.md

unpkg Travis

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

unpkg.com/:package@:version/:file

Examples

Using a fixed version:

You may also use a semver range or a tag instead of a fixed version number, or omit the version/tag entirely to use the latest tag.

If you omit the file path (i.e. use a "bare" URL), unpkg will serve the file specified by the unpkg field in package.json, or fall back to main.

Append a / at the end of a URL to view a listing of all the files in a package.

Query Parameters

?meta
Return metadata about any file in a package as JSON (e.g. `/any/file?meta`)
?module
Expands all ["bare" `import` specifiers](https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier) in JavaScript modules to unpkg URLs. This feature is *very experimental*

Cache Behavior

The CDN caches files based on their permanent URL, which includes the npm package version. This works because npm does not allow package authors to overwrite a package that has already been published with a different one at the same version number.

URLs that do not specify a package version number redirect to one that does. This is the latest version when no version is specified, or the maxSatisfying version when a semver version is given. Redirects are cached for 5 minutes.

Browsers are instructed (via the Cache-Control header) to cache assets for 4 hours.

Feedback

If you think this is useful, we'd love to hear from you. Please reach out to @unpkg with any questions or concerns.

Sponsors

The project is sponsored by Cloudflare and Heroku.