npm.io
1.0.0 • Published 8 years ago

rduk-cache

Licence
MIT
Version
1.0.0
Deps
3
Vulns
0
Weekly
0

RDUK - Cache

Build Status Coverage Status

Manage cache in your Node.js app

Installation

# install rduk-cache module
npm install rduk-cache --save --save-exact

# install rduk-cache store (here redis)
npm install rduk-cache-store-redis --save --save-exact

Cache Store implementations

How to use
cache store configuration
  1. Add a config.yml file to your app (more information)
  2. Add a cacheStore section (see below for redis configuration)
---
cacheStore:
    name: redis
    providers:
        -
            name: redis
            type: rduk-cache-store-redis
            url: redis://...
var cache = require('rduk-cache');
Promise set(key, value)
cache.set('key', {
    prop1: 'value 1',
    prop2: 'value 2'
})
Promise get(key)
cache.get('key')
    .then(function(obj) {
        console.log(obj.prop1); // output: 'value 1'
    });

Keywords