node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

pusher-ps-cache

pusher-ps-cache

An implementation of ps-cache, pubsub caching library, using pusher.com real-time messaging medium.

Features

  • Local in memory caching
  • Real-time cache invalidation

Getting Started

var pscache = require('ps-cache');
var cache = new pscache.Cache();
 
//Pusher configuration 
var listenerOpts = {
  cache: cache,
  app_id: ...,
  key: ...,
  secret: ...,
  cluster: ...,
  channel: ...
};
 
//Create pusher listener 
var pusherListener = new pusherBaseListener.PusherListener(listenerOpts);
cache.attachListener(pusherListener);
 
//Set to cache 
cache.set(key, value);
 
//Get value by key or null if key doesn't exists 
cache.get(key);
 
//Remove from local cache and notify for global invalidation 
cache.remove(key)

Requirements

Node.js >= 6.0

Installation

With npm do:

npm install pusher-ps-cache -save

About

This project is funded and maintained by Mobiltron, Inc.. We ❤️ open source software!

Check out our other open source projects or say 👋 on twitter @mobiltron.

Contribute

Contributions are welcome 🤘 We encourage developers like you to help us improve the projects we've shared with the community. Please see the Contributing Guide and the Code of Conduct.

Authors

See also the list of contributors who participated in this project.

License

pusher-ps-cache is available under the MIT license. See the LICENSE file for more info.