Skip to content

v0.47.0 — file storage

Choose a tag to compare

@tshafer tshafer released this 11 Jul 15:57
· 111 commits to main since this release

A driver-agnostic file storage layer on a pluggable Disk — the core imports no filesystem or SDK, so it runs on Node and the edge.

  • setDisk(disk, name?) then storage(name?): put (string / Uint8Array / ArrayBuffer) / get / getText / exists / delete / list(prefix?) / url.
  • MemoryDisk — a full in-memory driver and the default, so storage() works in tests with no setup.
  • Point disks at the local filesystem (Node), S3 (fetch), or a Cloudflare R2 binding — adapters for all three are in the docs.
  • Register several disks by name and select with storage("s3").

302 tests; type-checked doc examples (which caught a policy-class typing footgun last release, and kept the driver examples honest here). See docs/storage.md.