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

cache-manager-pouchdb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-manager-pouchdb

Node cache store for PouchDB

  • 0.1.1-beta
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Node Cache Manager store for PouchDB

The PouchDB store for the Node Cache Manager Module found on Github and NPM.

Status

Currently the code is in beta. I am using it in an application that was origininally going to use the redis store. Incomplete:

  1. Tests
  2. Code clean up
  3. examples on using remote server
  4. examples on replication
  5. examples of syncing

Installation

npm install cache-manager-pouchdb --save

Usage examples

Here are examples that demonstrate how to implement the PouchDB cache store.

Features

  • Replication
  • Syncing

Single store example

var cacheManager = require('cache-manager');
var pouchDBStore = require('cache-manager-pouchdb');

var pouchDBCache = cacheManager.caching({
    store: pouchDBStore,
    options: {
        path: './cache',
        ttl: 600
    }
});

var ttl = 60;
pouchDBCache.set('foo', 'bar', {ttl: ttl}, function(err) {
    if (err) { throw err; }
        
    pouchDBCache.get('foo', function(err, result) {
        console.log(result);
        // >> 'bar'
        pouchDBCache.del('foo', function(err) {});
    });
});

Promises example

pouchDBCache.wrap(key, function() {
    return somePromise(key);
})
.then(function(data) {
    console.log('Data:', data);
});

More examples

For more examples please visit the Overview and Usage Examples sections of the Node Cache Manager module

Tests

Tests need to be written.

npm test

Contribution

If you would like to contribute to the project, please fork it and send me a pull request to the dev branch.

License

node-cache-manager-pouchdb is licensed under the MIT license.

FAQs

Package last updated on 17 Apr 2016

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