Kitten-cache
Highly performant LRU cache.
Install
- Install
npm i kitten-cache
- Require the dependence
const Cache = ;
- Declare new instance
let cache = ;
API
Instance
options /* options : { size : default 50, onRemove : function to call when a key/value is removed from the cache } */
Cache.set(key, value)
let cache = ; cache;
Cache.get(key)
let cache = ; cache; cache; // -> 1
Cache.has(key)
let cache = ; cache; cache; // -> true cache; // -> false
Cache.delete(key)
let cache = ; cache; cache; // -> true cache; // -> false