localstorage-cache
storage
Installation
In a browser:
<script src="localstorage-cache.js"></script>
Using npm:
$ npm i -g localstorage-cache
$ npm i --save localstorage-cache
Usage:
import LocalStorageCache from 'localstorage-cache';
const storageCache = new LocalStorageCache(2 * 1024, 'LRU');
storageCache.setCache('name', 'lzwaiwai', 'utf8').setCache('age', 18);
storageCache.setCache('work', 'IT', 24 * 60 * 60);
const cacheWork = storageCache.getCache('work');
console.log(cacheWork);
storageCache.deleteCache('age');
storageCache.clearCache();
...