+
keyv-pouchdb
Third party PouchDB storage adapter for Keyv.
Motivation
Leveraging pouchdb-lru-cache as a keyv-storage-adapter that complies with the api specs.
Installation
$ npm install --save keyv-pouchdb # Then add a pouchdb adapter $ npm install pouchdb-adapter-memory --save$ npm install pouchdb-adapter-http --save$ npm install pouchdb-adapter-node-websql --save
Usage
const KeyvPouchDB = ;const Keyv = ; const store = // default options maxCacheSize: 5000000 // maximum cache size in bytes. 0 for limitless [memory only] overwriteExisting: false // replace existing entries pouchDB: // pouchDB configuration options adapter: "memory" // pouchdb adapter database: "keyv-pouchdb-cache" // database (string | uri) remoteConfig: {} // configuration options for remote database ; /* * or connect to a remote instance * * npx pouchdb-server --port 3000 --in-memory * */"http://localhost:3000/keyv-pouchdb-cache"; // loads `pouchdb-adapter-http` /* * * or maybe even sqlite3 * */"database.db"; // loads `pouchdb-adapter-node-websql` /****************************/ const keyv = store ;
License
MIT © wmik