Keyv

Keyv

github.com

1

About this website

Keyv is a simple, lightweight key-value store for Node.js with a unified API that works across multiple storage backends. Originally created by Luke Childs and now maintained by Jared Wray, Keyv is designed to be the simplest possible persistent key-value store, with a clean and consistent API that abstracts away the differences between storage engines. The core philosophy is: one API, any backend. With the same simple get, set, and delete operations, developers can seamlessly switch between in-memory storage, Redis, PostgreSQL, MySQL, SQLite, MongoDB, etcd, Memcached, and more, simply by changing the connection URI. This makes Keyv particularly useful for applications that need to support different storage backends in different environments (e.g., SQLite for development, Redis for production). Key features include: TTL (Time To Live) support for automatic key expiration, with millisecond precision; namespace support via key prefixes, allowing multiple isolated key-value stores within the same backend; serialization and deserialization via pluggable codecs (JSON by default, with support for custom serializers); a storage adapter architecture where each backend is a separate npm package (keyv-redis, keyv-postgres, keyv-mysql, keyv-sqlite, keyv-mongo, keyv-memcache, keyv-etcd); event emission for lifecycle hooks (set, get, delete events); and a map-like API that is immediately familiar to JavaScript developers. Keyv is widely used in the Node.js ecosystem as the default cache adapter for popular HTTP caching middleware like lru-cache and apicache. With over 18,000 GitHub stars and over 3 million weekly npm downloads, Keyv is one of the most popular caching solutions for Node.js. It is licensed under the MIT license.

Tags & Categories

Categories

Tags

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!