Skip to content

v0.4.0

Choose a tag to compare

@harshdoesdev harshdoesdev released this 10 Mar 23:52
· 78 commits to main since this release

Streaming I/O, process control, and file watching - across the full stack.

Spawn long-running processes in the VM and stream stdout/stderr back in real-time. Kill processes, write to stdin, and watch directories for file changes - all concurrently within a single sandbox.

What's new

  • spawn() - stream stdout/stderr as it happens, no more waiting for the command to finish
  • kill() - terminate running processes
  • stdin - write to a spawned process's stdin
  • watch() - guest-side inotify file watching (detects creates, modifications, deletions, renames through tmpfs overlays)
  • Concurrent operations - run a dev server, tests, and a file watcher simultaneously in the same VM
  • cwd support - set working directory per command

Example

const sb = await Sandbox.start();

const server = await sb.spawn("npm run dev", { cwd: "/workspace" });
server.on("stdout", (data) => process.stdout.write(data));

await sb.watch("/workspace", (e) => console.log(e.event, e.path));

const result = await sb.exec("npm test");

await server.kill();
await sb.stop();

Full Changelog: v0.3.3...v0.4.0