couch-cache

0.2.4 • Public • Published

Couch Cache

A cache solution for CouchDB documents.

CouchCache uses the _changes feed in CouchDB to invalidate documents.

Usage

var CouchCache = require('couch-cache')
 
var cache = new CouchCache({ db: 'http://localhost:5984/database'
                           , max: 1000
                           })
 
cache.get('document_id', function (err, doc) {
  console.log(doc)
})

Install

$ npm install couch-cache

Options

The db option is required. All options in follow and lru-cache is available except for the since option in follow.

  • prefix A string to prefix the CouchDB ids with.

API

CouchCache inherits from EventEmitter. All the method on AsyncCache is proxied.

  • CouchCache#destroy Stops the changes watcher.

Licence

MIT

/couch-cache/

    Package Sidebar

    Install

    npm i couch-cache

    Weekly Downloads

    7

    Version

    0.2.4

    License

    MIT

    Unpacked Size

    5.29 kB

    Total Files

    5

    Last publish

    Collaborators

    • tellnes