modules served last 30d.

Create modern(es2015+) web apps easily with NPM packages in browser/deno.

No build tools needed!

import confetti from ""

How to Use is a modern CDN that allows you to import es6 modules from a URL:

import Module from "[/PATH]";

or build a module with custom input(code):

import { esm } from "";

const { render } = await esm`
  /* @jsx h */
  import { h } from "npm:preact@10.13.2";
  import { renderToString } from "npm:preact-render-to-string@6.0.2";
  export const render () => renderToString(<h1>Hello world!</h1>);
console.log(render()); // "<h1>Hello world!</h1>"

More usage check out here.

You may want to use bare specifier instead of URL with import maps:

<script type="importmap">
    "imports": {
      "react": ""
<script type="module">
  import React from "react" // alias to

Importing from NPM

import React from "";

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

import React from "";        // 18.2.0 (latest)
import React from "^17";    // 17.0.2
import React from ""; // 18.3.0-canary-7cd98ef2b-20230509

You can import submodules of a package:

import { renderToString } from "";

or import/fetch non-module(js) as following:

import "" assert { type: "json" };

Importing from GitHub Repos

You can also import modules/assets from a github repo: /gh/OWNER/REPO[@TAG]/PATH. For example:

import tslib from "";

or load a svg image from a github repo:

Specifying Dependencies

By default, rewrites import specifiers based on the package dependencies. To specify the version of these dependencies, you can add the ?deps=PACKAGE@VERSION query. To specify multiple dependencies, separate them with a comma, like this: ?deps=react@17.0.2,react-dom@17.0.2.

import React from "";
import useSWR from "";

Aliasing Dependencies

import useSWR from "";

in combination with ?deps:

import useSWR from "";

The original idea came from @lucacasonato.

Tree Shaking

By default, exports a module with all its exported members. However, if you want to import only a specific set of members, you can specify them by adding a ?exports=foo,bar query to the import statement.

import { __await, __rest } from ""; // 7.3KB
import { __await, __rest } from ",__rest"; // 489B

By using this feature, you can take advantage of tree shaking with esbuild and achieve a smaller bundle size. Note that this feature is only supported for ESM modules and not CJS modules.

Bundling Strategy

By default, bundles sub-modules in the dependency tree when you import a module.

You can also bundle all dependencies of a package into a single JS file by adding ?bundle-deps query to the import URL:

import { Button } from "";

Bundling deps can reduce the number of network requests and improve performance. However, it may bundle shared code repeatedly. In extreme case, it may break the side effects of the package, or change the import.meta.url pointing. To avoid this, you can add ?no-bundle to disable the default bundling behavior:

import "";

For package authors, you can specify the bundling strategy by adding the field to package.json:

  "name": "foo",
  "": {
    "bundle": false, // disables bundling behavior

Development Mode

import React from "";

With the ?dev option, builds a module with process.env.NODE_ENV set to "development" or based on the condition development in the exports field. This is useful for libraries that have different behavior in development and production. For example, React will use a different warning message in development mode.

ESBuild Options

By default, checks the User-Agent header to determine the build target. You can also specify the target by adding ?target, available targets are: es2015 - es2022, esnext, deno, and denonext.

import React from "";

Other supported options of esbuild:

  • Conditions
    import foo from ",custom2";
  • Keep names
    import React from "";
  • Ignore annotations
    import React from "";

Web Worker supports ?worker query to load the module as a web worker:

import workerFactory from "";

const worker = workerFactory();

You can pass some custom code snippet to the worker when calling the factory function:

const workerAddon = `
self.onmessage = function (e) {
const worker = workerFactory(workerAddon);

Package CSS

<link rel="stylesheet" href="">

This only works when the package imports CSS files in JS directly.

Importing WASM Modules supports importing wasm modules in JS directly, to do that, you need to add ?module query to the import URL:

import wasm from "";

const { exports } = new WebAssembly.Instance(wasm, imports);

Using Import Maps

Import Maps has been supported by most modern browsers and Deno natively. This allows bare import specifiers, such as import React from "react", to work. supports ?external=foo,bar query to specify external dependencies. With this query, will not rewrite the import specifiers of the specified dependencies. For example:

  "imports": {
    "preact": "",
    "preact-render-to-string": ""

Alternatively, you can mark all dependencies as external by adding a * prefix before the package name:

  "imports": {
    "preact": "",
    "preact-render-to-string": "*preact-render-to-string@5.2.0",
    "swr": "*swr@1.3.0",
    "react": ""

Import maps supports trailing slash that can not work with URL search params friendly. To fix this issue, provides a special format for import URL that allows you to use query params with trailing slash: change the query prefix ? to & and put it after the package version.

  "imports": {
    "react-dom": "",
    "react-dom/": ""
} also provides a CLI Script in Deno to generate and update the import maps that resolves dependencies automatically.

Escape Hatch: Raw Source Files

In rare cases, you may want to request JS source files from packages, as-is, without transformation into ES modules. To do so, you need to add a ?raw query to the request URL.

For example, you might need to register a package's source script as a service worker in a browser that does not yet support the type: "module" option:

await navigator.serviceWorker.register(
  new URL(
  { scope: '/' }

You may alternatively use as the origin, which is equivalent to

<playground-project sandbox-base-url=""

so that transitive references in the raw assets will also be raw requests.

Deno Compatibility is a Deno-friendly CDN that resolves Node's built-in modules (such as fs, os, etc.), making it compatible with Deno.

import express from "";

const app = express();
app.get("/", (req, res) => {
  res.send("Hello World");

For users using deno < 1.31, uses as node compatibility layer. You can specify a different version by adding the ?deno-std=$VER query:

import postcss from "";

Deno supports type definitions for modules with a types field in their package.json file through the X-TypeScript-Types header. This makes it possible to have type checking and auto-completion when using those modules in Deno. (link).

Figure #1

In case the type definitions provided by the X-TypeScript-Types header are incorrect, you can disable it by adding the ?no-dts query to the module import URL:

import unescape from "";

This will prevent the X-TypeScript-Types header from being included in the network request, and you can manually specify the types for the imported module.

Supporting Nodejs/Bun

Nodejs(18+) supports http importing under the --experimental-network-imports flag. Bun doesn't support http modules yet.

We highly recommend Reejs as the runtime with that works both in Nodejs and Bun.

Building Module with Custom Input(code)

This is an experimental API that allows you to build a module with custom input(code).

  • Imports NPM/GH packages
  • Supports TS/JSX syntaxes
  • Bundle mulitple modules into a single JS file
import build from "";

const ret = await build({
  dependencies: {
    "preact": "^10.13.2",
    "preact-render-to-string": "^6.0.2",
  code: `
    /* @jsx h */
    import { h } from "preact";
    import { renderToString } from "preact-render-to-string";
    export function render(): string {
      return renderToString(<h1>Hello world!</h1>);
  // for types checking and LSP completion
  types: `
    export function render(): string;

// import module
const { render } = await import(ret.url);
// import bundled module
const { render } = await import(ret.bundleUrl);

render(); // "<h1>Hello world!</h1>"

or use the esm tag function to build and import js/ts snippet quickly in browser with npm packages:

import { esm } from "";

const { render } = await esm`
  /* @jsx h */
  import { h } from "npm:preact@10.13.2";
  import { renderToString } from "npm:preact-render-to-string@6.0.2";
  export const render () => renderToString(<h1>Hello world!</h1>);
console.log(render()); // "<h1>Hello world!</h1>"

Pinning Build Version

To ensure stable and consistent behavior, you may want to pin the build version of a module you're using from This helps you avoid potential breaking changes in the module caused by updates to the server.

The ?pin query allows you to specify a specific build version of a module, which is an immutable cached version stored on the CDN.

import React from "";
// or use version prefix
import React from "";

By using the ?pin query in the import statement, you can rest assured that the version of the module you're using will not change, even if updates are pushed to the server. This helps ensure the stability and reliability of your application.

For UI libraries like React and Vue, uses a special build version stable to ensure single version of the library is used in the whole application.

Using CLI Script provides a CLI script for managing imports with import maps in Deno and Node/Bun (via Reejs). This CLI script automatically resolves dependencies and uses a pinned build version for stability.

To use the CLI script, you first need to run the init command in your project's root directory:

deno run -A -r init

Once you've initialized the script, you can use the following commands to manage your imports:

# Adding packages
deno task esm:add react react-dom     # add multiple packages
deno task esm:add react@17.0.2        # specify version
deno task esm:add react:preact/compat # using alias

# Updating packages
deno task esm:update react react-dom  # update specific packages
deno task esm:update                  # update all packages

# Removing packages
deno task esm:remove react react-dom

The CLI script works with Node/Bun via Reejs:

# Initializing
reejs x init
# Using reejs tasks
reejs task esm:add    react
reejs task esm:update react
reejs task esm:remove react


Which browsers are supported? supports all modern browsers which support ES6 Module. Including Deno.

Does support private npm packages?

Nope, but you can deploy your own server to support private npm packages. Check our self hosting guide.

Why I get timeout error?

When first time you import a module, needs to build the module then cache it. If the module is too large, it may take a long time to build. You can try again later, since it's queued and will be built soon.

Why I get The source code is invalid... error in Deno?

Since Deno 1.18+ will generate the deno.lock file for the dependencies, but builds code with different version of esbuild when you imports modules from different build version. To fix this issue, please try to pin the build version like Or use the CLI Script to manage the dependencies that will fix the build version automatically.

Does support Subresource Integrity (SRI)?

Browsers don't yet support SRI for ES6 Module. Deno (1.18+) supports hash check by generating the deno.lock file.

How can I report a bug?

Please open an issue on GitHub. Thanks :)