Wondering what’s next for npm?Check out our public roadmap! »

    cache-register-redis

    0.9.0 • Public • Published

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

    Keywords

    Install

    npm i cache-register-redis

    DownloadsWeekly Downloads

    0

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    2.96 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar