memorycache
v0.0.1
Published
a simple memory based cache with expiring keys for node.js
Downloads
11
Readme
memorycache
simple in memory cache for Node.js with expiring keys
//create a cache object with size 100
var cache = require('memorycache').create(100);
// set foo:bar
cache.set('foo', 'bar');
//return bar
cache.get('foo');
//delete foo
cache.delete('foo');
//expire a key after 1 second...
cache.set('see you', 'later', 1000);
//cancel expire
cache.expire('see you', 0);
//get keys
cache.keys();
//get expiring keys
cache.expireKeys();
//get date expires... null if none
cache.expiresAt('some key');
//get ttl -- 0 if none
cache.ttl('some key');
Logging uses bunyun.