Unstorage offers a small async key-value API for JavaScript with many built-in drivers, mountable backends, JSON serialization, and optional HTTP serving.
Overview
Unstorage is a JavaScript library that unifies key-value access behind one async API across runtimes such as Node.js, Bun, Deno, browser environments, and Workers. A compact core pairs with numerous drivers for memory, filesystems, browsers, databases, and cloud backends.
You can mount multiple drivers under path prefixes on a single storage instance, similar to combining filesystems. Values can be JSON with automatic serialization, or binary and raw payloads for media and other non-text data. Utilities support metadata, watching for changes, snapshots, and hydration from plain objects.
The package is tree-shakable and ships with an in-memory default. An HTTP storage mode includes a built-in server for remote access patterns. Documentation covers driver selection and composition for application frameworks that need portable persistence code.
The design targets authors who want one storage abstraction in libraries or apps without rewriting persistence logic for each deployment target.
Key features
- Async key-value API
- Multi-driver prefix mounting
- Built-in memory driver
- JSON auto serialization
- Binary and raw values
- Storage watcher support
- Snapshots and hydration
- HTTP storage with server
Use cases
- Portable app persistence layer
- Framework cache and session storage
- Combining cloud and local drivers
- Worker and edge key-value access