1.0.0 • Published 9 months ago

nila-cache v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Nila in memory cache

Installation

npm install nila-cache --save

Usage

const cache = require('nila-cache');

// now just use the cache

cache.store('name', 'sivabharathy');
console.log(cache.get('foo'));

// that wasn't too interesting, here's the good part
cache.store('houdini', 'disappear', 100, function(key, value) {
    console.log(key + ' did ' + value);
}); // Time in ms

// create new cache instance
const newCache = new cache.NilaCache();

newCache.store('name', 'gotocva');

setTimeout(function() {
  console.log('name in old cache is ' + cache.get('foo'));
  console.log('name in new cache is ' + newCache.get('foo'));
}, 200);