Because caching should be simple! A Javascript cache helper object. Supports in-memory and local storage caching as well as cache expiration.
npm install cache-it --save
- type: 'MEMORY' for memory cache or 'LOCAL' for html5 local storage (compatible with I8+)
- name: namespace for the cache's instance
- expiry: amount of seconds that the cache will be valid for
var CacheIt = require('cache-it');
var cache = new CacheIt('MEMORY', 'usersStore', 180);
cache.put('myKey', 'myValue');
var value = cache.get('myKey');
console.log(value);
npm test
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
- 1.0.0 Initial release