Files
skills/docs/networking/drive/drive
2026-05-29 08:20:56 +01:00
..
2026-05-29 08:20:56 +01:00
2026-05-29 08:20:56 +01:00

@suaveplan/drive - Modular virtual filesystem core for Suaveplan. File-level operations over AbstractStorage with a plugin slot for middleware, chunking, encryption, and P2P mesh.

Summary

Modular virtual filesystem core for Suaveplan. File-level operations over AbstractStorage with a plugin slot for middleware, chunking, encryption, and P2P mesh.

Documentation tree

  • drive — Core Drive class — a virtual filesystem over AbstractStorage with plugin and middleware support.
    • drive — Core Drive class — a virtual filesystem over AbstractStorage with plugin and middleware support.
    • file-location-index — Implements FileLocationIndex, the in-memory map populated by Drive.hydrateFrom and consulted by `Drive.getKeyStatus…
    • get-key-status — Implements Drive.getKeyStatus(path), the synchronous three-state lock-icon lookup (DTP-22). Returns 'unencrypted',…
    • get-presence — Implements Drive.getPresence(path), the chunk-level progress lookup (DTP-23). Returns the ChunkPresence shape (`chu…
    • hydrate-from — Implements Drive.hydrateFrom(template, options), the orchestrator that turns a server-signed DriveTemplate into a p…
  • error-codes — Defines the structured error registry for @suaveplan/drive. Every failure mode the package can produce is registered…
    • error-codes — Defines the structured error registry for @suaveplan/drive. Every failure mode the package can produce is registered…
  • delete — Implements the deletion helper that powers Drive.delete(path, signal?). Delegates to the underlying `DriveStorage.del…
  • list — Implements the listing helper that powers Drive.list(prefix?, options?). Delegates to the underlying `DriveStorage.li…
  • read — Implements the byte-reading helper that powers Drive.read(path, options?). Delegates to the underlying `DriveStorage.…
  • stat — Implements the metadata helper that powers Drive.stat(path, signal?). Delegates to the underlying `DriveStorage.getMe…
  • streams — Implements createReadStream and createWriteStream for Drive. Each function inspects the storage's `capabilities.n…
  • write — Implements the byte-writing helper that powers Drive.write(path, data, options?). Delegates to the underlying `DriveS…
  • plugins — (no submodules)
  • schemas — (no submodules)
- [registry](./src/plugins/registry.md) — _(no submodules)_- [schemas](./src/schemas/drive-options.schema.md) — _(no submodules)_- [drive-options.schema](./src/schemas/drive-options.schema.md) — _(no submodules)_- [error-codes](./src/error-codes.md) — Defines the structured error registry for `@suaveplan/drive`. Every failure mode the package can produce is registered…
  • registry — (no submodules)- schemas — (no submodules)- drive-options.schema — (no submodules)- error-codes — Defines the structured error registry for @suaveplan/drive. Every failure mode the package can produce is registered…
  • registry — (no submodules)- schemas — (no submodules)- drive-options.schema — (no submodules)- error-codes — Defines the structured error registry for @suaveplan/drive. Every failure mode the package can produce is registered…
  • registry — (no submodules)- schemas — (no submodules) - drive-options.schema — (no submodules)- error-codes — Defines the structured error registry for @suaveplan/drive. Every failure mode the package can produce is registered…

Install

bun add @suaveplan/drive

Quick start

import { Drive } from "@suaveplan/drive";
import { MemoryStorage } from "@suaveplan/storage/memory";

const storage = Object.assign(new MemoryStorage(), { id: "local" });
const drive = new Drive(storage);
await drive.initialize();
await drive.write("hello.txt", new TextEncoder().encode("world"));
const data = await drive.read("hello.txt");
console.log(new TextDecoder().decode(data)); // "world"
await drive.dispose();

Modules