esm.sh is an open CDN that transforms and serves JavaScript modules from HTTP URLs for browser and Deno imports without a local bundler. It supports import maps, on-the-fly TS and Vue, and optional self-hosting.
Overview
esm.sh lets developers import packages from npm, JSR, GitHub, and pkg.pr.new URLs directly in the browser or Deno. The service bundles or transforms modules with esbuild, exposes query parameters for dependencies, aliasing, tree shaking, dev builds, targets, and raw source access.
Features include CSS-in-JS import handling, web worker loading, external dependency markers for import maps, cache purge with proof-of-work, Deno-friendly Node builtin shims, TypeScript types via headers, and esm.sh/tsx for in-HTML TSX without a build step. Package authors can steer behavior through package.json exports and esm.sh fields.
A global hosted network fronts the public service; operators can also run their own instance using the hosting documentation. Node.js and Bun are not supported clients of the CDN itself.
The design targets modern ES2015+ web development where bare specifiers resolve through import maps to CDN URLs instead of local node_modules bundling.
Key features
- HTTP imports for npm JSR and GitHub
- Import map friendly bare specifiers
- On-the-fly TypeScript Vue and Svelte
- esbuild bundling and tree shaking
- Dev builds and target selection
- Deno Node builtin compatibility
- Cache purge API with proof-of-work
- esm.sh/tsx in-browser TSX helper
Use cases
- Browser apps without a bundler
- Deno projects using npm packages
- Prototyping with import maps
- Self-hosted module CDN in private networks