Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyv-pouchdb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyv-pouchdb

PouchDB storage adapter for Keyv

  • 0.1.0-alpha.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

keyv+ PouchDB logo
keyv-pouchdb

Third party PouchDB storage adapter for Keyv.

Build Status npm

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 = require("keyv-pouchdb");
const Keyv = require("keyv");

const store = new KeyvPouchDB({
  // 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
 * 
 */
new KeyvPouchDB("http://localhost:3000/keyv-pouchdb-cache"); // loads `pouchdb-adapter-http`

/*
 * 
 * or maybe even sqlite3
 * 
*/
new KeyvPouchDB("database.db"); // loads `pouchdb-adapter-node-websql`

/****************************/

const keyv = new Keyv({ store });

License

MIT © wmik

Keywords

FAQs

Package last updated on 26 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc