lesca-local-storage
v1.1.2
Published
save data convert to base64 width timestamp
Downloads
10
Readme
Why use it?
save data by base64 in local storage.
Live Demo
Installation
npm install lesca-local-storage --save
Usage
import Storage from 'lesca-local-storage';
// set any type of data
Storage.set('keyName', { anyKey: 'anyValue', name: 'anyName' });
// get data from storage
const { data, timestamp } = Storage.get('keyName');
console.log(data); //{ anyKey: 'anyValue', name: 'anyName' }
console.log(timestamp); // get milliseconds => (set data time ------> now)
Development
Methods
| method | description | return | | :-------------------------------------------- | :----------------: | -----: | | .set(key:string, data:object) | set data as a key | void | | .get(key:string) | get data as a key | void | | .remove(key:string) | remove data by key | void | | .clear() | clear all data | void |
Features
- maintain if necessary