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

@capsule-run/vpod

v0.8.5

Published

Lightweight, secure sandboxes for untrusted processes. Browser and Node.

Readme

Live demo • Documentation • Issues

It uses a RISC‑V architecture and runs entirely inside WebAssembly, so the same sandbox runs in a browser tab and in Node.

  • Fast startup : under a second, and about 0.6s on a repeat visit.
  • Portable : a browser tab or Node, no server and no native dependency.
  • Isolated : all execution state stays inside the WASM sandbox.

Installation

npm install @capsule-run/vpod

Usage

Everything is async, because loading the engine and fetching a snapshot are.

Persistent session (Recommended)

All calls share the same running sandbox. await using cleans it up when the scope ends:

import { Sandbox } from "@capsule-run/vpod";

await using sandbox = await Sandbox.create();

await sandbox.commands.run("export FOO=bar");
await sandbox.commands.run("touch /tmp/data.csv");

const result = await sandbox.commands.run("echo $FOO");
console.log(result.stdout); // bar

If your toolchain does not support await using, call await sandbox.close() yourself.

Python REPL

Run Python with persistent state across calls. Variables and imports live for the lifetime of the session.

import { Sandbox } from "@capsule-run/vpod";

await using sandbox = await Sandbox.create();

await sandbox.code.run("import json");
await sandbox.code.run("data = [1, 2, 3]");

const result = await sandbox.code.run("print(sum(data))");
console.log(result.text); // 6

Choosing a snapshot

await using sandbox = await Sandbox.create({ snapshot: "vsnap-data" });

await sandbox.code.run("import pandas as pd");
await sandbox.code.run("print('Pandas is ready!')");

Suspend & Resume

Pause a sandbox and resume it later. Only dirty memory pages are saved, so a delta is a couple of megabytes rather than the size of the snapshot.

The delta is bytes, not a location. Put it wherever you keep state, which for a hosted app is usually your own backend:

const sandbox = await Sandbox.create();
await sandbox.commands.run("uv pip install --system requests");

const delta = await sandbox.suspend(); // Uint8Array, ~2 MiB
await sandbox.close();

// Later, possibly in another tab or another process:
const resumed = await Sandbox.resume({
    id: "my-instance",
    snapshotId: sandbox.snapshotId,
    delta,
});
await resumed.code.run("import requests; print(requests.__version__)");

In a browser you can let the SDK keep it in origin-private storage instead:

const instanceId = await sandbox.suspendToOpfs();
const resumed = await Sandbox.resume(instanceId);

| Method | Description | |:---|:---| | sandbox.suspend() | Suspend and return the delta bytes | | sandbox.suspendToOpfs() | Suspend into browser storage, returns an instance id | | Sandbox.resume(idOrInstance) | Resume from an id or from delta bytes | | Sandbox.listInstances() | List instances held in browser storage | | Sandbox.destroy(id) | Delete a stored instance |

Snapshots

The first Sandbox.create() downloads a snapshot and caches it locally, in origin-private storage in a browser and on disk in Node. Later runs use the cache.

import { snapshots } from "@capsule-run/vpod";

for (const entry of await snapshots.catalog()) {
    console.log(entry.name, entry.tag);
}

Available snapshots

| Name | Tag | Description | Memory Limit (RAM) | |:---|:---|:---|:---| | alpine | 3.23.0 | Minimal Alpine Linux snapshot. | 256 MB | | vsnap-base | 1.0.0 | Alpine-based general-purpose snapshot with Python. | 256 MB | | vsnap-base-512mb | 1.0.0 | Same as vsnap-base with more memory headroom. | 512 MB | | vsnap-data | 1.0.0 | Alpine-based snapshot with numpy, pandas, and scipy. | 512 MB |

Managing the cache

A cached snapshot is a few tens of megabytes, so it is worth being able to show people what is stored and let them get it back.

for (const entry of await snapshots.cached()) {
    console.log(entry.id, entry.byteLength);
}

const reclaimed = await snapshots.clear();

clear() returns the number of bytes it freed and keeps suspended sandboxes, which are stored alongside the snapshots. Pass { instances: true } to drop those as well. The next Sandbox.create() downloads again.

On Node the cache directory is shared with the other vpod tools, so clear() removes only what it downloaded itself and leaves anything it cannot fetch again. cached() still lists everything that is there.

In a browser this is site data rather than the HTTP cache, so clearing cached images and files in the browser's own settings will not touch it. A browser is also free to evict it when the disk fills up, which costs a re-download and nothing else. snapshots.SnapshotStore.persist() asks it not to. Firefox asks the user, so call it from something they clicked rather than on startup.

Documentation

Visit the Vpod documentation for the full guide and API reference. Implementation notes and measurements live in docs/browser-phases/. To report issues or contribute, head to the main GitHub repository.