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

@ricsam/isolate-daemon

v0.1.10

Published

Node.js daemon server for running isolated-vm runtimes via IPC

Downloads

898

Readme

@ricsam/isolate-daemon

Node.js daemon server that manages isolated-vm runtimes via Unix socket or TCP. Allows non-Node.js runtimes (Bun, Deno, etc.) to use isolated-vm through IPC.

Installation

npm add @ricsam/isolate-daemon

Features

  • Unix domain socket and TCP transport
  • Multiple concurrent connections
  • Runtime lifecycle management (create, dispose)
  • Bidirectional callback bridging (console, fetch, fs)
  • Test environment support (enabled via testEnvironment: true)
  • Playwright integration (client owns the browser, daemon invokes callbacks)
  • Connection-scoped resource cleanup
  • Namespace-based runtime pooling with LRU eviction for performance optimization

Starting the Daemon

import { startDaemon } from "@ricsam/isolate-daemon";

const daemon = await startDaemon({
  socketPath: "/tmp/isolate-daemon.sock", // Unix socket
  // Or TCP: host: "127.0.0.1", port: 47891
  maxIsolates: 100,
  defaultMemoryLimitMB: 128,
});

console.log(`Daemon listening on ${daemon.address}`);

// Get stats
const stats = daemon.getStats();
console.log(`Active isolates: ${stats.activeIsolates}`);

// Graceful shutdown
await daemon.close();

CLI Usage

# Start daemon on default socket
npx isolate-daemon

# Custom socket path
npx isolate-daemon --socket /var/run/isolate.sock

# TCP mode
npx isolate-daemon --host 127.0.0.1 --port 47891

Options

interface DaemonOptions {
  socketPath?: string;      // Unix socket path
  host?: string;            // TCP host
  port?: number;            // TCP port
  maxIsolates?: number;     // Maximum concurrent isolates
  defaultMemoryLimitMB?: number; // Default memory limit in megabytes
}

Statistics

interface DaemonStats {
  activeIsolates: number;
  activeConnections: number;
  totalIsolatesCreated: number;
  totalRequestsProcessed: number;
}

Runtime Pooling with Namespaces

The daemon supports namespace-based runtime pooling for improved performance. When a client creates a runtime with a namespace ID, the runtime is cached on dispose (soft-delete) rather than destroyed. Future requests with the same namespace ID reuse the cached runtime, preserving:

  • V8 Isolate instance
  • V8 Context
  • Compiled ES module cache
  • Global state and imported modules

How It Works

  1. Client creates a namespace: client.createNamespace("tenant-123")
  2. Client creates a runtime in that namespace: namespace.createRuntime(options)
  3. On dispose, runtime is soft-deleted (cached in pool)
  4. Any client can later request the same namespace and reuse the cached runtime
  5. When maxIsolates limit is reached, oldest disposed runtimes are evicted (LRU)

Pooling Behavior

  • Non-namespaced runtimes (client.createRuntime()) work as before - true disposal on dispose
  • Namespaced runtimes are cached and reusable across connections
  • LRU eviction removes oldest disposed runtimes when at capacity
  • Connection close soft-deletes namespaced runtimes (keeps them in pool)

The maxIsolates limit includes both active and pooled (disposed) runtimes. This ensures predictable memory usage while allowing runtime reuse.

License

MIT