groupon / node-cached

A simple caching library for node.js, inspired by the Play cache API
BSD 3-Clause "New" or "Revised" License
94 stars 15 forks source link

Provide a way to manually delete a cached value #30

Closed minispeck closed 8 years ago

minispeck commented 8 years ago

would be nice if there was a .del method to delete a cached value by providing a key.

myCache.del(key);

love the simplicity of this library - but imo it needs a delete method.

currently we are using a workaround:

myCache.set(key, '', {'expire': 1});

not the most elegant. i would have expected that setting null or undefined would be equivalent to deleting but that doesnt seem to be the case.

jkrems commented 8 years ago

Thanks to @fdegiuli there's a myCache.unset(key) starting with cached@4.3.0. In case you still need it. :)