What is UNPKG?
UNPKG serves as a content delivery network specifically designed for npm packages, allowing developers to access and load any file from npm using simple URL patterns. It supports various package versioning formats including specific versions, semver ranges, and npm tags, with automatic resolution to the latest version when none is specified.
The platform enables no-build applications by allowing direct loading of JavaScript modules in HTML through import maps, making it ideal for prototypes and small projects. It also provides a metadata API for retrieving file information and leverages Cloudflare's global edge network for high-performance caching and low-latency delivery worldwide.
Features
- Package Loading: Access any npm package file via URL patterns with version support
- No-Build Apps: Load JavaScript modules directly in HTML using import maps without build steps
- Metadata API: Retrieve file information including path, size, type, and integrity values
- Global CDN: Leverages Cloudflare's edge network for fast, worldwide content delivery
- Version Support: Handles specific versions, semver ranges, npm tags, and automatic latest resolution
Use Cases
- Loading JavaScript libraries in web projects without bundlers
- Creating prototypes and small applications without build pipelines
- Accessing npm package files directly in browser-based development
- Retrieving package metadata for development tools
- Serving frontend dependencies in no-build applications