What problem does it solve?
Unstorage provides a single, consistent key-value API across runtimes and backends so developers can persist, cache, and namespace data without coupling application logic to a specific storage engine.
Core Features & Use Cases
- Runtime-agnostic API: Works on Node, Bun, Deno, and edge Workers with async methods and automatic JSON serialization.
- Pluggable drivers & mounting: Swap or mount memory, filesystem, Redis, Cloudflare KV, MongoDB, HTTP, and many other drivers at namespace prefixes.
- Utilities & tooling: Supports snapshots and restore, prefixStorage for scoped namespaces, watch events, HTTP server access, and simple custom driver creation for specialized backends.
- Typical use cases: caching with TTL, session stores, file-backed assets, layered overlays, backups/seeding for tests, and remote access via the HTTP driver.
Quick Start
Create a storage instance, mount the desired driver, and use storage.setItem and storage.getItem to persist and retrieve values.