npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reearth/zushi

v0.2.1

Published

A framework-agnostic plugin runtime: run untrusted plugin code in an isolated WASM backend (QuickJS built in), expose a host-defined API, and render plugin UI in sandboxed iframes.

Readme

zushi

A framework-agnostic plugin runtime for the browser. Run untrusted plugin code in an isolated WASM backend — a built-in QuickJS backend runs JavaScript, with room for other guest languages — expose a host-defined API into it, and render plugin UI inside sandboxed <iframe>s (or, opt-in, on a host <canvas>).

The name comes from zushi (厨子), a small Japanese cabinet that enshrines a precious object behind doors you open only when needed — much like a host that encloses an external module and opens it to render on demand.

Why

Running third-party plugin code safely in a web app needs two layers of isolation, and zushi packages both plus the wiring between them:

  1. A language VM behind a pluggable Backend (QuickJS for JavaScript by default) — plugin logic never touches the host realm (no window, document, fetch) unless you hand it over.
  2. Sandboxed iframes for plugin UI — opaque origin, postMessage-only.

Only data crosses these boundaries; code and live references do not.

Install

npm install @reearth/zushi

Quick start

import { Plugin, quickjs } from "@reearth/zushi";

const plugin = new Plugin({
  backend: quickjs(), // the execution backend (QuickJS WASM VM)
  surfaces: { main: { container: document.getElementById("plugin-ui")! } },
  code: `
    // Runs inside the VM — no DOM access.
    reearth.ui.show("<h1>Hello from a plugin</h1>");
    host.greet("world");
  `,
  // Build the globals the plugin sees (only \`console\` is provided by default).
  exposed: ({ surfaces }) => ({
    reearth: { ui: surfaces.main.api },
    host: { greet: (name: string) => console.log(`plugin greeted ${name}`) }
  })
});

await plugin.start();
// ...later
plugin.dispose();

Using React? PluginView / usePlugin (@reearth/zushi/react) tie a plugin to a component's lifecycle. Want declarative, component-based UI instead of HTML strings? Opt into the JSX runtime with jsx: true. Drawing to a canvas? Swap in a host-direct renderer (e.g. react-konva). All covered in the docs below.

Documentation

Full docs live in docs/:

Exact option/type signatures are documented inline via TSDoc and shipped as .d.ts — let your editor's hover/autocomplete be the reference.

Examples

pnpm example   # Vite dev server: React, vanilla, JSX runtime, and a canvas renderer

See examples/ — one file per case. The vanilla example's plugin source is also driven by a real-browser regression test (examples/regression.browser.test.ts), so it doubles as an end-to-end check of the whole pipeline.

Testing

  • pnpm test — unit/logic tests in jsdom (VM behavior is real QuickJS; iframe DOM stubbed).
  • pnpm test:browser — real-browser tests (Vitest browser mode / Playwright Chromium): real srcdoc, injected scripts, postMessage, ResizeObserver auto-resize, sandbox isolation, and the examples end-to-end. Run npx playwright install chromium once.
  • pnpm test:all — both.

License

MIT