in-memory ttl cache. that's it
$ npm i @purpose/ttl-cache
import c from '@purpose/ttl-cache';
const cache = c();
cache.set('foo', 'bar');
console.log(cache.get('foo'));
create cache that keep items for opts.ttl || 300000
ms, and does cleanup
every opts.interval || 60000
ms.
get item by key, or null if expired or missing
set item by key
get current cache size (might contain expired items too)
MIT