node-cache
node-cache copied to clipboard
keys() writes checks that get() can't cash
I'd like to do something like this:
const values = cache.keys().map((key) => cache.get(key));
Based on the documentation, I expect:
- that
valuesdoes not contain anynulls if I had not inserted any intocache, - that
cachedoes not delete elements while timers do not have a chance to run and - that a function named
getdoes not delete elements.
Currently memory-cache deletes elements both with timers and as a side-effect within get among other methods. I think it would be helpful to write such design decisions high up in the README. The API description of get in the README does not explain this behavior. The uncertainty in the result of del is the only hint about side-effects.