@waffle-os/runtime
v0.0.160
Published
A WebAssembly runtime that lets programs share one filesystem, process tree, pipes, and loopback network in a browser tab.
Readme
@waffle-os/runtime
A WebAssembly runtime that lets programs share one filesystem, process tree, pipes, and loopback network in a browser tab.
Install
bun add @waffle-os/runtimeQuick start
Register the filesystem worker (fs-worker.ts):
import "@waffle-os/runtime/browser/fs-worker";Create one runtime per cross-origin isolated page (app.ts):
import { createRuntime } from "@waffle-os/runtime";
const runtime = createRuntime({ filesystem: { workerURL: "/fs-worker.js", mode: "memory" } });
await runtime.filesystem.writeFile("/hello.txt", "hello from Waffle");
console.log(new TextDecoder().decode(await runtime.filesystem.readFile("/hello.txt")));
await runtime.dispose();