Delete value at key. Returns true if value was in the cache, false if not.
Empty out all keys, reverting the cache to clear state.
Get value at key, or return undefined
Returns true if cache contains value at given key. Note that there is no performance benefit to calling this over get(), it's just a convenience method.
Returns an iterator of all the keys currently in cache. Performs vacuum beforehand, so the keys you get are guaranteed to be actually non-expired. Keys are provided converted to string.
Returns value if it is already in cache. Otherwise, calls the "provider" method (that must be given through options) and stores the value in cache, before returning it.
Set value at key. Optionally set ttl for this particular key, otherwise use the global default. If value is undefined, the key is deleted from cache.
Set TTL specifically for this key
Generated using TypeDoc
Entirely adequate node.js in-memory cache with lru and ttl support