1.0.0 • Published 10 years ago
cachish v1.0.0
cachish
A simple name/value expiring evented asynchronous cache
##Usage
var Cachish = require('cachish')
var cache = new Cachish(300000) //feed a timeout value in msecs, default is 10 minutes
cache.set('itemName', 'hello')
cache.get('itemName').then(function (value) {
console.log(value) //=> hello
})##API
get(key)- returns aPromisefor the value ofkeyin cacheadd(key, value)- adds to the cache asynchronouslyupdate(key, value)- updateskeyin the cachedelete(key)- removeskeyand its value from the cacheclear()- empties cache
##Events
add- occurs when an item is addedupdate- occurs when an item is updateddelete- happens when an item is deletedempty- occurs when cache is cleared
##Questions/comments
File an issue
1.0.0
10 years ago