@acyclic-labs/fs
v0.1.5
Published
Versioned workspaces for browser, memory, hosted, and native providers
Readme
@acyclic-labs/fs
Versioned, forkable workspaces backed by browser, memory, hosted, or native providers. The import path selects the environment and its guarantees.
npm install @acyclic-labs/fsimport { DEFAULT_OBJECT_CACHE_OPTIONS, openBrowserFs } from "@acyclic-labs/fs/browser";
const fs = await openBrowserFs({
databaseName: "my-app",
maximumObjectBytes: 64 * 1024 * 1024,
objectAcceleration: "opfs",
objectCache: DEFAULT_OBJECT_CACHE_OPTIONS,
});
const workspace = await fs.createWorkspace("main");
await workspace.write("/hello.txt", new TextEncoder().encode("hello"));
const fork = await workspace.fork("experiment");
console.log(fork.name);/browser (also the default export) uses the browser's storage capabilities and bundled WebAssembly; /memory is process-local; /hosted connects to a service; /native uses the native companion. Choose the entry point explicitly when moving between environments. Workspace generations are immutable identities; transactions and forks make changes without rewriting old generations. Durability, isolation, and mount behavior depend on the chosen provider.
See the browser example, API source, and Filesystem protocol.
