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

hatchvm

v0.1.0

Published

TypeScript SDK for the Hatch microVM orchestrator

Readme

hatchvm

TypeScript SDK for the Hatch microVM platform. Spin up Firecracker microVMs, execute commands, and expose services.

Install

npm install hatchvm

Quick start

import { create } from "hatchvm";

const hatch = create({ apiKey: "your-api-key" });

// Create a VM
const vm = await hatch.createVM({ vcpu_count: 2, mem_mib: 512 });

// Run a command
const result = await hatch.exec(vm.id, "echo hello world");
console.log(result.stdout); // "hello world\n"

// Expose a port to the internet
const route = await hatch.createRoute(vm.id, { target_port: 8080 });
console.log(`Live at: https://${route.subdomain}.hatchvm.com`);

VM lifecycle

// Create with cloud-init user data
const vm = await hatch.createVM({
  vcpu_count: 2,
  mem_mib: 512,
  user_data: `#cloud-config
packages:
  - python3
`,
});

// List all VMs
const vms = await hatch.listVMs();

// Get a specific VM
const info = await hatch.getVM(vm.id);

// Stop and delete
await hatch.stopVM(vm.id);
await hatch.deleteVM(vm.id);

Command execution

Commands run inside the VM via SSH. By default they have a 10 second timeout.

// Basic command
const result = await hatch.exec(vm.id, "ls -la /home");

// Custom timeout (30 seconds)
const build = await hatch.exec(vm.id, "make build", { timeout_ms: 30000 });

// Background mode — returns immediately with pid and log file
const server = await hatch.exec(vm.id, "python3 -m http.server 8080", {
  background: true,
});
console.log(server.pid);      // PID of the background process
console.log(server.log_file); // Path to stdout/stderr log on the VM

// Read background process output
const logs = await hatch.exec(vm.id, `cat ${server.log_file}`);

Foreground vs background

| Mode | Behavior | |------|----------| | Foreground (default) | Blocks until the command finishes or timeout_ms is reached. If it times out, timed_out: true is set and the process keeps running in the VM. | | Background | Returns immediately with pid and log_file. The process runs detached in the VM. Poll the log file to check output. |

Routing

Expose VM ports to the internet via *.hatchvm.com subdomains.

// Auto-generated subdomain
const route = await hatch.createRoute(vm.id, { target_port: 3000 });

// Custom subdomain
const route = await hatch.createRoute(vm.id, {
  target_port: 8080,
  subdomain: "my-app",
});
// => https://my-app.hatchvm.com

// List and delete routes
const routes = await hatch.listRoutes(vm.id);
await hatch.deleteRoute(route.id);

Snapshots

Snapshot a running VM and restore it later.

const snapshot = await hatch.snapshotVM(vm.id);
const restored = await hatch.restoreVM(vm.id);
const snapshots = await hatch.listSnapshots(vm.id);

Metrics

const metrics = await hatch.getMetrics(vm.id);
console.log(metrics.uptime_seconds);
console.log(metrics.net.rx_bytes);
console.log(metrics.vcpu.utilization_percent);

Error handling

All API errors throw a HatchError with the HTTP status code.

import { HatchError } from "hatchvm";

try {
  await hatch.getVM("nonexistent");
} catch (err) {
  if (err instanceof HatchError) {
    console.log(err.message); // Error message from the API
    console.log(err.status);  // HTTP status code (e.g. 404)
  }
}

Requirements

  • Node.js 18+
  • No runtime dependencies

License

MIT