storage-manager
Storage Manager module that help you manage your local and session storage
- Support TTL functionality
{ minutes: 2 }
- Support multiple values like
{ minutes: 3, seconds: 30 }
Installing
npm install storage-manager --save
Some examples
import { LocalStorage } from 'storage-manager';
const options = { minutes: 2 }
LocalStorage.set('some-key', 'some-value', options)
LocalStorage.get('some-key')
import { LocalStorage } from 'storage-manager';
LocalStorage.set('forever-key', 'some-value')
LocalStorage.remove('forever-key')
import { LocalStorage } from 'storage-manager';
const options = { minutes: 4, seconds: 30, refreshTTL: false }
LocalStorage.set('some-key', 'some-value', options)
LocalStorage.get('some-key')
import { LocalStorage } from 'storage-manager';
LocalStorage.clearAll()