esm.sh
esm.sh
What it is
esm.sh is an open-source service for importing JavaScript modules through HTTP URLs, so developers can use packages in browser apps or Deno without build tools. It serves packages from npm, JSR, GitHub and pkg.pr.new, and can transform TypeScript, TSX, Vue and Svelte files for direct imports. Modules are bundled by default; URL options let developers alter bundling, request raw content, set dependency versions or aliases, and select exports. Export selection does not work with CommonJS modules. The service supports CSS imports when a package imports CSS directly from JavaScript, and it can load modules as web workers. Build targets include es2015 through es2024, esnext, Deno, denonext and Node. A lightweight TSX script can compile and cache TSX written directly in HTML. The FAQ describes compatibility with modern browsers that support ES6 modules, including Deno. The public CDN does not support private npm packages; the project directs those users to self-hosting and provides a Docker image and deployment instructions. The project is MIT-licensed, with bug reports directed to GitHub issues.
Spec sheet
- Purpose
- esm.sh lets developers import JavaScript modules from HTTP URLs to build modern web apps using npm packages in browsers or Deno without build tools.Read 10 Oct 2026 · esm.sh
- Browser features
- esm.sh supports CSS imports and loading modules as web workers; CSS importing only works when the package imports CSS from JavaScript directly.Read 10 Oct 2026 · esm.sh
- Bundling options
- esm.sh bundles modules by default and offers `?standalone`, `?bundle=false`, and `?raw` options to change bundling or transformation behavior.Read 10 Oct 2026 · esm.sh
- Compatibility
- The FAQ says esm.sh supports modern browsers that support ES6 modules, including Deno.Read 10 Oct 2026 · esm.sh
- Dependency controls
- Import URLs can specify dependency versions with `?deps=` and substitute packages with `?alias=`.Read 10 Oct 2026 · esm.sh
- Edge compute
- noneRead 22 Sep 2026 · esm.sh
- Edge locations
- 330Read 22 Sep 2026 · esm.sh
- On-the-fly transforms
- It can transform .ts, .tsx, .vue, and .svelte files for direct browser imports without build steps.Read 10 Oct 2026 · esm.sh
- Private packages
- The public CDN does not support private npm packages; the FAQ directs users to self-host esm.sh for that use case.Read 10 Oct 2026 · esm.sh
- Runtime targets
- Build targets include es2015 through es2024, esnext, Deno, denonext, and Node.Read 10 Oct 2026 · esm.sh
- Security and integrity
- The FAQ says an integrity metadata map CLI is in progress and notes that Deno 1.18+ can check hashes using a generated `deno.lock` file.Read 10 Oct 2026 · esm.sh
- Self-hosting
- The project provides a Docker image and deployment instructions; its hosting guide recommends Linux with systemd, at least four CPU cores, 8GB RAM, and 100GB disk.Read 10 Oct 2026 · github.com
- Support and license
- The site directs bug reports to GitHub issues and identifies esm.sh as an open source project under the MIT License, maintained by @ije.Read 10 Oct 2026 · esm.sh
- Supported sources
- The CDN supports packages from npm, JSR, GitHub, and pkg.pr.new.Read 10 Oct 2026 · esm.sh
- Tree shaking
- The `?exports=` option can select specific module exports, but this feature does not work with CommonJS modules.Read 10 Oct 2026 · esm.sh
- TSX support
- The lightweight 1KB `esm.sh/tsx` script lets developers write TSX directly in HTML, with source compiled and cached at the edge.Read 10 Oct 2026 · esm.sh
Plans and prices
Strong points and limits
Strong points
- Serves packages from npm, JSR, GitHub and pkg.pr.new.
- Transforms TypeScript, TSX, Vue and Svelte.
- Supports dependency versions and package aliases in URLs.
- Provides Docker and deployment instructions for self-hosting.
Limits
- Public CDN does not support private npm packages.
- Export selection does not work with CommonJS modules.
- CSS imports require packages to import CSS from JavaScript.
Who it suits
esm.sh suits developers who want to import public JavaScript packages directly into browser or Deno projects without a build step. Teams with private npm packages would need to consider the self-hosted option.
Verdict
esm.sh offers direct imports with several transformation and bundling controls, plus documented self-hosting for private-package use. Its CSS and export-selection behavior has specific limits to account for when choosing it.
Where Specifiction places it
- CDN Software#18 of 337.9
- CDN services#22 of 357.7