Skip to main content
Snapshots are coming soon and not yet available in the current SDK.
See Snapshots for usage examples and patterns.

Sandbox methods


resume()

resume(): Promise<void>
Resume the sandbox after a snapshot. The VM continues from exactly where it was paused.

snapshot()

snapshot(): Promise<Snapshot>
Capture the full VM state: memory, CPU registers, filesystem, everything. The sandbox is paused during capture. Call resume() to continue running, or use the snapshot to fork new sandboxes. Returns
TypeDescription
SnapshotHandle to the captured state

Snapshot (instance)


restore()

restore(sandboxName: string, opts?: RestoreOptions): Promise<Sandbox>
Fork a new sandbox from this snapshot. The new sandbox starts exactly where the original was - no boot, no setup. Each fork gets its own copy-on-write filesystem. Parameters
NameTypeDescription
sandboxNamestringName for the new sandbox
opts?{ memoryMib?: number, cpus?: number }Optional config overrides
Returns
TypeDescription
SandboxThe forked sandbox, ready to accept commands

saveNamed()

saveNamed(name: string): Promise<void>
Persist this snapshot under a name so it survives beyond the lifetime of the original sandbox. Named snapshots can be loaded later with Snapshot.get() to fork workers. Parameters
NameTypeDescription
namestringSnapshot name (e.g. "after-pip-install")

Snapshot (static)


Snapshot.delete()

static delete(name: string): Promise<void>
Delete a named snapshot from disk. Parameters
NameTypeDescription
namestringSnapshot name

Snapshot.get()

static get(name: string): Promise<Snapshot>
Load a previously saved named snapshot. Parameters
NameTypeDescription
namestringSnapshot name
Returns
TypeDescription
SnapshotThe loaded snapshot

Snapshot.list()

static list(): Promise<Array<SnapshotInfo>>
List all saved named snapshots. Returns
TypeDescription
Array<SnapshotInfo>All named snapshots