@aofl/cache-manager

Provides a unified class for storing objects in Storage-like Objects

Usage no npm install needed!

<script type="module">
  import aoflCacheManager from 'https://cdn.skypack.dev/@aofl/cache-manager';
</script>

README

@aofl/cache-manager

Provides a unified class for storing objects in Storage-like Objects. You can choose from localStorage, sessionStorage and memoryStorage.

Api Documentation

Examples

Installation

npm i -S @aofl/cache-manager

Usage

import {CacheManager, cacheTypeEnumerate} from '@aofl/cache-manager';

const cacheManager = new CacheManager('exampleNamespace', cacheTypeEnumerate.LOCAL)
cacheManager.setItem('hello', 'world');

console.log(cacheManager.getItem('hello')); // expected result: 'world'