Mycache
Mycache is a cache library enhanced front end local cache. It can provide 4 stores, includes indexedDB, localStorage, sessionStorage and memorayStore.
Installation
NPM is the easiest and fastest way to get started using Mycache.
# latest stable npm install mycache
How to use Mycache
Init cache
; const mycache = ;
Sample example used the promise/async form:
; const mycache = ; await mycache;const val = await mycache;
Configuration
; const mycache = name: 'mycache' // name prefix of key oldItemsCount: 02 // this count of old items stores: 'indexedDB' 'localStorage' // use first store if system support;
Mycache API:
// get value of key// get all value of keys// set key value and expire time// append key value and expire time// if the key has in local// remove key// get all keys// clear all keys// the length of all keys// each all keys by callback// if the key is expired// get all expired keys// get all overlength keys// if the key is old// get items by sorted