rightsize
Testcontainers-style integration testing on microVMs. No Docker required.
rightsize runs your integration-test containers as hardware-isolated microsandbox microVMs — one microVM per container — behind a strict-mode ESM TypeScript API whose flagship lifecycle is TC39 explicit resource management. The runtime self-provisions on first use (no install step), and a hand-rolled Docker backend covers the platforms microVMs can't reach.
ts
import { RedisContainer } from "rightsize/modules";
import { createClient } from "redis";
await using redis = await RedisContainer.start(); // boots a real microVM
const client = createClient({ url: redis.uri }); // redis://127.0.0.1:<mapped port>
await client.connect();
// ... your test ...await using is the whole story: redis is disposed automatically at the end of its scope, ordered and awaited, the same way a try/finally would — no framework required. See the quickstart for a runnable version and Lifecycle for how disposal actually works.
Where to go next
- New to rightsize? Start with the Quickstart — install, your first
await usingcontainer, and what happens on first run. - Want to run something right now? See the runnable examples under
examples/(npm run example:redis,npm run example:network,npm run example:test) — the README's Examples section has the full list and exact commands. - Need a specific container? Jump to Modules for the full catalog of eighteen preconfigured containers.
- Choosing a backend, or hitting a backend-specific limit? See Backends and Networking.
- Need to move files into or out of a running container, or skip repeated boot-and-seed work across a suite? See Copying files and Checkpoint / restore — both work on either backend.
- Using rightsize across Kotlin, Rust, and TypeScript? See Cross-language parity for the shared behavioral contract and how it's enforced.
Status
On npm as rightsize:
sh
npm install --save-dev rightsize