esm.sh
esm.sh
- Free plan
- Linux
- Web
- Self-hosted
What esm.sh is
esm.sh is a free, 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 transforms TypeScript, TSX, Vue, and Svelte files for direct browser imports. Bundling is on by default; URL options can change bundling behavior, request raw content, select exports, set dependency versions, or substitute packages. 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. Targets include es2015 through es2024, esnext, Deno, denonext, and Node. Its lightweight TSX script can compile and cache TSX written in HTML. The public CDN works with modern browsers that support ES6 modules, including Deno. Private npm packages are not supported on the public CDN; the project provides a Docker image and instructions for self-hosting. It is MIT licensed, with bug reports directed to GitHub issues.
Who it suits
esm.sh suits developers who want to import public JavaScript packages directly into browser apps or Deno without setting up build tools. Teams needing private npm packages can use its self-hosting instructions instead of the public CDN.
Good to know, and what to watch
- Serves packages from npm, JSR, GitHub, and pkg.pr.new
- Transforms TypeScript, TSX, Vue, and Svelte files
- Supports web workers and conditional CSS imports
- URL options control dependencies, aliases, and bundling
- MIT licensed and free to use
- Public CDN does not support private npm packages
- Export selection does not work with CommonJS
- CSS importing requires CSS imports from JavaScript
Plans
Every plan and priceesm.sh public CDN
Open source
Getting started
- Open https://esm.sh/
- Import a package from an HTTP URL in a browser or Deno project
- Set dependency versions with ?deps= or substitutions with ?alias= when needed
- Choose bundling, raw, or export options through the URL
- Use esm.sh/tsx for TSX written directly in HTML
- Self-host with the provided Docker image when private packages are needed
Limits to check
The public CDN has no private npm package support. Export selection does not work with CommonJS modules, and CSS importing applies only when the package imports CSS directly from JavaScript.
The verdict
esm.sh offers several ways to serve and transform public packages directly for browser and Deno use. Check its CommonJS, CSS-import, and private-package limits against your project’s needs.
Questions people ask
Is esm.sh free?
Yes. The public CDN is free, and the project is open source under the MIT License.
Which package sources are supported?
esm.sh supports packages from npm, JSR, GitHub, and pkg.pr.new.
Can it handle private npm packages?
The public CDN does not support private npm packages. The project directs users to self-host esm.sh for that use case.
Which runtimes and browsers are supported?
Targets include es2015 through es2024, esnext, Deno, denonext, and Node. The FAQ describes support for modern browsers with ES6 modules, including Deno.
Can esm.sh transform source files?
It transforms .ts, .tsx, .vue, and .svelte files for direct imports, and its lightweight TSX script compiles and caches TSX written in HTML.
What the maker publishes
- 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. source
- Bundling options
- esm.sh bundles modules by default and offers `?standalone`, `?bundle=false`, and `?raw` options to change bundling or transformation behavior. source
- Compatibility
- The FAQ says esm.sh supports modern browsers that support ES6 modules, including Deno. source
- Dependency controls
- Import URLs can specify dependency versions with `?deps=` and substitute packages with `?alias=`. source
- Edge compute
- none source
- Edge locations
- 330 source
- On-the-fly transforms
- It can transform .ts, .tsx, .vue, and .svelte files for direct browser imports without build steps. source
- Private packages
- The public CDN does not support private npm packages; the FAQ directs users to self-host esm.sh for that use case. source
- 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. source
- Runtime targets
- Build targets include es2015 through es2024, esnext, Deno, denonext, and Node. source
- 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. source
- 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. source
- 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. source
- Supported sources
- The CDN supports packages from npm, JSR, GitHub, and pkg.pr.new. source
- Tree shaking
- The `?exports=` option can select specific module exports, but this feature does not work with CommonJS modules. source
- TSX support
- The lightweight 1KB `esm.sh/tsx` script lets developers write TSX directly in HTML, with source compiled and cached at the edge. source
Checked against the maker's pages on 10 Oct 2026.