keyv-lru-wrapper

    0.1.0 • Public • Published

    keyv-lru-wrapper

    Keyv storage adapter wrapper which adds an LRU cache layer.

    Installation

    yarn add keyv-lru-wrapper
     
    npm i keyv-lru-wrapper

    Usage

    const Keyv = require('keyv');
    const KeyvRedis = require('@keyv/redis');
    const lruWrapper = require('keyv-lru-wrapper');
     
    const redis = new KeyvRedis('redis://user:pass@localhost:6379');
     
    const keyv = new Keyv({
      store: lruWrapper(redis, {
        maxItems: 100,
        ttl: 1000 * 60 * 60 * 24,
      }),
    });

    Install

    npm i keyv-lru-wrapper

    DownloadsWeekly Downloads

    50

    Version

    0.1.0

    License

    none

    Unpacked Size

    2.69 kB

    Total Files

    4

    Last publish

    Collaborators

    • visualfanatic