idb-keyval is a promise-based keyval store implemented with IndexedDB.
The tool solves the problem of needing simple, persistent client-side key-value storage in the browser. It wraps IndexedDB with a minimal API that handles the most common use case: storing and retrieving values by key. The approach is deliberately constrained to this single purpose, avoiding the complexity of more general-purpose database abstractions.
Developers should choose this tool when they need lightweight, async key-value storage without the overhead of larger libraries. It suits projects where bundle size matters and the storage requirements are straightforward—getting, setting, and clearing values. The README names localForage as an alternative that supports older browsers with broken IndexedDB implementations but is orders of magnitude larger. For more complex operations like iteration and indexing, the README points to the idb package on NPM as a heavier alternative. The tool supports storing anything structured-clonable and provides batch operations like setMany and getMany for efficiency, plus an update method that atomically transforms values without race conditions.
Development activity shows consistent maintenance with regular updates to dependencies and build tooling. The project maintains multiple build targets including ES modules, CommonJS, and legacy transpiled versions for older browsers. Documentation is thorough, with clear examples for each API method and explicit guidance on which bundle to use for different environments.