node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

multi-cache

multi-cache

a flexible cache for node.js with interchangeable storage backends inspired by web storage

NPM Version

Build Status Coverage Status Dependency Status Inline docs

Installing

To install the latest release with npm run

npm install multi-cache

to install the development version from github run:

npm install "git+https://github.com/belbis/multi-cache"

Introduction

The goal of this project is to provide a high level interface to an interchangeable number of caches

usage

simple memcached example:

var mc = require("multi-cache").getCache("memcached");
 
var getCallback = function(e,r) {
  if (e) throw e;
  console.log(r);
  mc.disconnect();
};
var setCallback = function(e,r) {
  if (e) throw e;
  mc.get("foo", getCallback);
};
var connectCallback = function() {
  mc.set("foo", "bar", setCallback);
};
mc.connect(connectCallback);

see more examples in the examples folder

tests

testing utilizes multi-cache-mocks, which is a project that can be found here https:/github.com/belbis/multi-cache-mocks

run with bash npm test

future

extend storage options