Skip to content

rd-uk/rduk-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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://...

module loading

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'
    });

Releases

No releases published

Packages

No packages published