@aofl/cache-manager
v3.14.1
Published
Provides a unified class for storing objects in Storage-like Objects
Downloads
751
Maintainers
Readme
@aofl/cache-manager
Provides a unified class for storing objects in Storage-like Objects. You can choose from localStorage, sessionStorage and memoryStorage.
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'