iamso / cacherrr

simple caching for the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cacherrr

simple caching for the browser

Install

npm install cacherrr

Example Setup

Javascript

import Cacherrr from 'cacherrr';

// create an instance
const cacherrr = new Cacherrr();

// set cached data for path
cacherrr.set('/path', {key: 'value'})
  .then(data => {console.log(data);})
  .catch(e => {console.error(e);});

// get cached data for path
cacherrr.get('/path')
  .then(data => {console.log(data);})
  .catch(e => {console.error(e);});

// clear cache for path
cacherrr.clear('/path');

// clear entire cache
cacherrr.clearAll();

License

MIT License

About

simple caching for the browser

License:MIT License


Languages

Language:JavaScript 100.0%