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

@buddhilive/sandbox

v0.1.0-beta.11

Published

Client-side Node.js sandbox running entirely in WebAssembly & Web Workers

Readme

@buddhilive/sandbox

Ultra-lightweight, zero-backend, client-side Node.js sandbox running entirely in WebAssembly & Web Workers.

Features

  • ⚡ Zero Backend: Runs 100% in the user's browser using WebAssembly and dedicated Web Workers.
  • 📁 In-Memory POSIX VirtualFS: Synchronous and asynchronous filesystem APIs (readFile, writeFile, mkdir, readdir, stat, symlink).
  • 🌐 In-Browser Web Application Previews: Intercepts HTTP/TCP listeners (http.createServer().listen(3000)) via Service Worker and renders them live at /__preview/:port/ inside <iframe> tags.
  • 📦 Client-Side NPM Package Installer: Installs packages directly from registry.npmjs.org using pure-JS decompression (fflate).
  • 🛠️ On-Demand Dynamic Native Toolchain: Lazily loads Python and Clang/Musl WASM compilers only when packages require node-gyp builds, keeping initial bundle size minimal.
  • 🔒 Cross-Origin Opener / Embedder Isolated: High-performance I/O streaming using SharedArrayBuffer lock-free ring buffers and Atomics.

Installation

npm install @buddhilive/sandbox
# or
pnpm add @buddhilive/sandbox
# or
yarn add @buddhilive/sandbox

Quickstart

import { Sandbox } from '@buddhilive/sandbox';

// 1. Initialize sandbox instance
const sandbox = await Sandbox.create();

// 2. Write a script to the in-memory VirtualFS
await sandbox.fs.writeFile(
  '/workspace/index.js',
  `console.log("Hello from inside the client-side Node.js Sandbox!");`
);

// 3. Spawn a process and stream stdout
const proc = await sandbox.process.spawn('node', ['/workspace/index.js']);

const reader = proc.stdout.getReader();
const decoder = new TextDecoder();

while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  console.log(decoder.decode(value));
}

const exitCode = await proc.exit;
console.log('Exited with code:', exitCode);

// 4. Clean up
await sandbox.dispose();

Web Server Previews

// Listen for virtual port events
sandbox.ports.on('listen', ({ port, url }) => {
  console.log(`Port ${port} opened at preview URL: ${url}`);
  previewIframe.src = url;
});

// Run a web server inside the sandbox
await sandbox.fs.writeFile('/workspace/server.js', `
  const http = require('http');
  const server = http.createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/html' });
    res.end('<h1>Live Preview from In-Browser Sandbox!</h1>');
  });
  server.listen(3000);
`);

await sandbox.process.spawn('node', ['/workspace/server.js']);

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│ Browser Main Thread (Host Application)                      │
│ - import { Sandbox } from '@buddhilive/sandbox'             │
│ - sandbox.fs / sandbox.process / sandbox.ports             │
└──────────────┬──────────────────────────────▲───────────────┘
               │ postMessage                  │ SAB Streams
               ▼                              │
┌─────────────────────────────────────────────┴───────────────┐
│ Web Worker (Execution Sandbox)                              │
│ - Rust WebAssembly (buddhilive-sandbox-core)                │
│ - In-Memory VirtualFS (Inode Table)                         │
│ - QuickJS Virtual Process Context                           │
│ - SPSC Lock-Free SharedArrayBuffer Ring Buffer              │
└─────────────────────────────────────────────────────────────┘

Opinionated Next.js Stack (next-stack Preset)

The SDK provides first-class, out-of-the-box support for a batteries-included, zero-server Next.js stack:

| Layer | Canonical Package | Verified Version | |---|---|---| | Styling | tailwindcss, @tailwindcss/postcss | ^4.0.0 | | Components | shadcn primitives, lucide-react | ^1.16.0 | | AI Elements | ai-elements | ^0.1.0 | | State | zustand | ^5.0.0 | | Database & ORM | drizzle-orm, @libsql/client (WASM) | ^0.38.0 / ^0.14.0 | | Authentication | better-auth | ^1.1.0 | | Generative AI | ai (Vercel AI SDK), @ai-sdk/openai | ^6.0.0 / ^1.1.0 |

Initializing with stackPreset

import { Sandbox, scaffoldNextStackApp } from '@buddhilive/sandbox';

// 1. Create sandbox with next-stack preset
const sandbox = await Sandbox.create({
  stackPreset: 'next-stack',
  maxMemoryMb: 1024,
});

// 2. Scaffold all 16 canonical config and starter files
await scaffoldNextStackApp(sandbox, {
  appName: 'my-app',
  withAuth: true,
  withAI: true,
});

// Or via the Sandbox instance helper
await sandbox.scaffoldNextStackApp();

License

MIT © BuddhiLive