easy-cache ![Build Status](https://secure.travis-ci.org/zonetti/easy-cache.png)
A simple NodeJS module to handle in-memory key/value cache.
Install
npm install easy-cache
Basic usage
var cache = require('easy-cache');
cache.set('foo', 'bar');
console.log(cache.get('foo'));
console.log(cache.size());
cache.unset('foo');
console.log(cache.get('foo'));
console.log(cache.size());
cache.set('temporary', 'value', 100);
console.log(cache.get('temporary'));
console.log(cache.exists('temporary'));
setTimeout(function() {
console.log(cache.get('temporary'));
if (!cache.exists('temporary')) {
console.log('Key does not exist');
}
cache.clear();
}, 150);
Credits
Inspired by node-cache.