Documentation / Node

Keep the mount optional in JavaScript.

The napi-rs package exposes the same split-store idea to Node: select metadata and blocks independently, set a chunk size, and release the filesystem explicitly when the process is done.

integrations/mount-rs-napi / current factory shape
const { createChunkedDriver } = require('./integrations/mount-rs-napi');

const fs = await createChunkedDriver({
  metadata: { kind: 'sqlite', uri: './metadata.sqlite' },
  blocks: { kind: 'sqlite', uri: './blocks.sqlite' },
  chunkSize: 65536,
});

try {
  await fs.writeFile('/hello', Buffer.from('hello'));
} finally {
  await fs.shutdown();
}

Factory choices

metadatamemory · sqlite · pglite

Namespace, leases, revisions, and publication.

blocksmemory · sqlite · pglite · r2

Immutable bytes and the barrier before publication.

lifecycleshutdown()

Releases provider-owned writer leases explicitly.

R2 is block-only here.

In createChunkedDriver, metadata must use memory, SQLite, or PGlite. R2 supplies immutable blocks; it is not a metadata store.

Read the package, then read the caveats

The example mirrors the repository README and the generated TypeScript declarations. Provider configuration is not a promise that every combination has passed the full acceptance matrix: live credentials, service restart, SQLite hosting, and platform-specific gates remain separate evidence.