Skip to content
GitHub Get Started
Getting Started

TypeScript SDK

The secure-exec package is the TypeScript SDK. It exports NodeRuntime, the batteries-included entry point for booting a virtualized VM and running guest JavaScript, plus the types describing its options and results.

Terminal window
npm install secure-exec
import { NodeRuntime } from "secure-exec";
const rt = await NodeRuntime.create();
try {
const { stdout } = await rt.exec("console.log('hi', 1 + 1)");
console.log(stdout);
} finally {
await rt.dispose();
}

The full type-level reference is generated from the source with TypeDoc and is the source of truth for every export, method, and option.