0.9.0 • Published 6 years ago

cache-register-redis v0.9.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

cache-register-redis

Redis storage for cache-register

Installation

npm install --save cache-register-redis

Usage

Too-Quick Example

async slowFunction(x, y) {
  /* some async operation that takes 5 seconds */
}


const Redis = require('redis');

const { CacheRegister } = require('cache-register');
const RedisStorage = require('cache-register-redis');


const redisStorage = new RedisStorage({
  redis: Redis.createClient(),
  ttl:   5000,    // 5000ms
});

const cachedFunction = CacheRegister({
  storage: redisStorage,
  valueFunc: slowFunction,
});
0.9.0

6 years ago

0.8.1

7 years ago

0.8.0

7 years ago