0.1.1 • Published 7 years ago

cachius v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Cachius

A simple generic Javascript caching layer.

Usage

$ npm install cachius

let Cachius = require('cachius');

let count = function() {
  console.log('Counting');
  return 10;
};

//This first call will cause the method to be called once.
Cachius.cache(count, 'count');

//This will simply return the cached result stored under the 'count' key
Cachius.cache(count, 'count');

//This will clear the cache for the 'count' key
Cachius.touch('count');

//The count method will now be called again since the key has been touched
Cachius.cache(count, 'count');
0.1.1

7 years ago

0.1.0

7 years ago