A lightweight key-value store built on top of MongoDB, providing a simple get/set/getMany API with optional custom serialization. Version 0.1.0 is in early development with no stable release cadence. Differentiates from other KV stores by leveraging MongoDB's flexibility and your own database connection, with TypeScript generics for type safety. Currently supports only asynchronous operations and a single collection per instance.
npm install keyvalifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a key-value store with MongoDB, sets a document, retrieves it, and fetches multiple keys.
Update mongodb dependency to ^5.0.0 or later.
Ensure await mongoClient.connect() is called before initializing kv.
Always provide an options object with at least { db, collectionName }.Pass a valid MongoDB Db object: keyvalify({ db: yourDb, collectionName: '...' })Remove useNewUrlParser and useUnifiedTopology from MongoClient options.
Change to: import { keyvalify } from 'keyvalify'