localstorage-cache
storage
Installation
In a browser:
Using npm:
$ npm i -g localstorage-cache$ npm i --save localstorage-cache
Usage:
; /* * Set cache size: 2 * 1024KB(2MB) * set cache strategy: LRU / LFU; */const storageCache = 2 * 1024 'LRU'; // /** * set cache, and unit of expire is second. * @param {string/number} key * @param * @param * @param */storageCache;storageCache; /** * get cache by key. * @param {string/number} key * @returns */const cacheWork = storageCache;console; /** * delete cache by key. * @param {string/number} key */storageCache; /** * delete all cache. */storageCache;...