Skip to content

Keyv storage adapter wrapper which adds an LRU cache layer

License

Notifications You must be signed in to change notification settings

damianstasik/keyv-lru-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Keyv storage adapter wrapper which adds an LRU cache layer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published