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

@arnilo/liveframe-runner-quickjs

v0.4.1

Published

An isolated Liveframe runner: widget code runs in QuickJS inside a child process the runner can kill, so a host gets a real isolation boundary without building a sandbox.

Readme

@arnilo/liveframe-runner-quickjs

An isolated Liveframe runner. Widget code runs in QuickJS (WebAssembly, via quickjs-emscripten) inside a Bun child process that the runner owns and can kill. A host gets a real isolation boundary for hostile widget code without building a sandbox.

Requires Bun ≥ 1.4.2 and @arnilo/liveframe ~0.4.1. No Node runtime is supported.

import { quickjsRunner } from "@arnilo/liveframe-runner-quickjs";

const runner = await quickjsRunner({ memoryBytes: 32 << 20, stackBytes: 256 << 10, timeoutMs: 250 });
const result = await runner.render(pkg, inputs, { catalog, capabilities, surfaceId: "home", revision: 1 });
runner.close(); // kills the child

It is a Runner (spec §7.5): use it wherever the app passes one, for example renderPlacement({ runner, … }) from /host, or runner: in the liveframe mcp config. Call close() when done.

Options

| Option | Default | Meaning | | --- | --- | --- | | memoryBytes | 32 MiB | QuickJS heap limit per runtime | | stackBytes | 256 KiB | QuickJS stack limit. Not 1 MiB: QuickJS recurses on the host stack, and at 1 MiB some call shapes overflow it first, which aborts the engine | | timeoutMs | 250 | Soft deadline: QuickJS's interrupt handler stops the render. A render's options.timeoutMs overrides it | | reuse | "none" | "none": every render gets a new runtime in a new wasm instance. "package": one runtime per package hash is kept, so module state and the last parsed (catalog, capabilities) configuration (keeping the compiled validator cache warm) survive between renders. Faster; for code you trust to behave but have not tested, never for hostile code | | maxRuntimes | 16 | Runtimes kept with reuse: "package", least recently used evicted first |

What it does

  • No host API in the realm. Widget code sees only ECMAScript built-ins. fetch, process, Bun, Deno, require, WebAssembly, timers and console are undefined; globalThis.constructor.constructor("return this")(), eval and new Function reach only the sandbox; import() goes to a loader that serves only the Liveframe kit, the package and its pinned libraries.
  • A channel widget code cannot write to. The parent–child channel is not reachable from the realm, so a widget cannot answer for another render.
  • Law 2 on the host. The host verifies the package hash and the library pins before anything is loaded and validates every tree the child returns. A malformed or forged answer is render-failed.
  • Limits. Heap, stack and time are limit-exceeded. A render stuck in one native call (QuickJS cannot interrupt those) is ended by killing the child 100 ms after the soft deadline; the next render starts a new child.
  • Templates run on the host. A template package runs no author code, so it needs no sandbox and renders in the parent.
  • Pending jobs never run. The runner never calls executePendingJobs(); a package whose top-level await does not settle is render-failed. A wasm instance whose engine throws to the host is dropped, never reused.

What it does not protect against

  • The child runs with the host's privileges (with an empty environment). Only QuickJS stands between widget code and the file system and network. A defect in QuickJS or in the wasm runtime is not covered. Run the child inside an OS sandbox (bubblewrap, a container) for defence in depth.
  • CPU side channels and timing.
  • Memory pressure on the host up to memoryBytes per runtime, plus the wasm instance and the child's baseline. With reuse: "package", up to maxRuntimes runtimes at once. Measured (Linux, plan 031 Task 8): the child holds about 52 MiB resident at start, 74 MiB steady with reuse: "none" and about 90 MiB with reuse: "package" over five packages, with no growth across 500 and 1000 renders. The host parses at most what the heap allows, and a tree beyond the validator's limits is invalid-prop (a 14 MiB text node was).
  • Renders run one at a time. The runner owns one child, so a render waits for the one before it. A hostile widget that holds its render costs every render queued behind it up to timeoutMs + 100 ms plus about 250 ms to replace the child (measured: hold, kill, recover and next render 246 ms). Give untrusted authors their own runner, or keep their timeoutMs low.
  • Only Linux has been measured. macOS and Windows are expected to work (WebAssembly and Bun.spawn) and are not claimed.

Cost

Measured on one Linux machine (Bun 1.4.4), agent-home (679 nodes): a fresh render is about 70 ms, of which about 30 ms is the fixed cost of a runtime and the kit; the child starts in about 21 ms; killing a stuck child and rendering the next request takes about 140–190 ms. See plans/evidence/031-runner-options.md in the repository. Templates and trusted code are cheaper with templateRunner() and workerRunner().

Prove a runner with runnerSuite() from @arnilo/liveframe/conformance; this package passes the contract and isolation cases.