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

@computesdk/run-cloud

v1.0.2

Published

Run Cloud provider for ComputeSDK - fast Firecracker microVM sandboxes with snapshots and filesystem access

Readme

@computesdk/run-cloud

Run Cloud provider for ComputeSDK. Run commands inside fast Firecracker microVM sandboxes with configurable CPU, memory, and disk, native file reads, snapshots, and automatic idle pause.

Installation

npm install computesdk @computesdk/run-cloud

Create an API key in the Run Cloud dashboard and export it:

export RUN_CLOUD_API_KEY=rc_live_your_key

RUN_CLOUD_API_TOKEN is supported as a backwards-compatible alias. Set RUN_CLOUD_API_URL only when targeting a custom Run Cloud deployment.

Usage

import { compute } from 'computesdk';
import { runCloud } from '@computesdk/run-cloud';

compute.setConfig({
  provider: runCloud({
    apiKey: process.env.RUN_CLOUD_API_KEY,
    cpu: 2,
    memory: 4096,
    disk: 40,
  }),
});

const sandbox = await compute.sandbox.create({
  templateId: 'runcloud/agent-base',
  name: 'agent-task',
});

const result = await sandbox.runCommand('node --version');
console.log(result.stdout);

await sandbox.filesystem.writeFile('/tmp/result.txt', result.stdout);
console.log(await sandbox.filesystem.readFile('/tmp/result.txt'));

const snapshot = await compute.snapshot.create(sandbox.sandboxId, {
  name: 'after-setup',
});

await sandbox.destroy();

const restored = await compute.sandbox.create({
  snapshotId: snapshot.id,
  name: 'restored-task',
});

The provider factory can also be used directly:

const cloud = runCloud({ apiKey: process.env.RUN_CLOUD_API_KEY });
const sandbox = await cloud.sandbox.create({ cpu: 1, memory: 1024 });

Configuration

interface RunCloudConfig {
  apiKey?: string;
  apiUrl?: string;
  fetch?: typeof fetch;
  image?: string;
  cpu?: number;
  memory?: number;
  disk?: number;
  idlePauseSeconds?: number;
  timeout?: number;
  region?: string;
  orgId?: string;
  commandTimeout?: number;
  tunnelTtlSeconds?: number;
}
  • cpu accepts fractional vCPU values.
  • memory is measured in MiB.
  • disk is the writable disk quota in GiB.
  • timeout and commandTimeout are milliseconds.
  • tunnelTtlSeconds controls public port URL lifetime and defaults to one hour.
  • idlePauseSeconds is seconds; set it to 0 to disable automatic pause.
  • templateId and image both select a registered Run Cloud OCI image.
  • snapshotId restores a previously created Run Cloud snapshot.
  • Fresh creates accept per-create cpu, memory, disk, idlePauseSeconds, timeoutSeconds, region, name, orgId, and idempotencyKey overrides.
  • Snapshot restores accept cpu, memory, disk, timeoutSeconds, region, and name overrides. Options the restore API cannot apply are rejected instead of being silently ignored.

Run Cloud does not currently support persistent sandbox-level envs. Pass command-scoped variables with:

await sandbox.runCommand('echo "$MODEL"', {
  env: { MODEL: 'gpt-5' },
});

Supported Operations

| Method | Supported | Notes | |---|---|---| | create | ✅ | Fresh image boot or snapshot restore; restore-safe overrides are validated and applied. | | getById | ✅ | Returns null when the sandbox does not exist. | | list | ✅ | Lists running sandboxes visible to the API key. | | destroy | ✅ | Idempotent when the sandbox is already gone. | | runCommand | ✅ | Supports cwd, command-scoped env, timeouts, streaming callbacks, and detached background commands. | | getInfo | ✅ | Refreshes state and resource metadata from Run Cloud. | | getUrl | ✅ | Opens an expiring capability URL without making the sandbox persistent. | | Filesystem | ✅ | Native reads; shell-backed write, mkdir, list, exists, and remove. | | Snapshots | ✅ | Create, list, delete, and restore through snapshotId. |

sandbox.getInstance() returns a RunCloudSandbox handle containing the official Client and the latest native sandbox record.

Tunnel hostnames are random bearer capabilities. Do not write them to public logs. They expire automatically and are removed when the tunnel or sandbox is deleted.