0.1.0 • Published 3 years ago
new-large-localstorage v0.1.0
large-localstorage
Safe local storage wrapper for large data. What is the max size of localStorage values?
Usage
- Install
npm i --save large-localstorage
API
API is same with window.localstorage
.
import lls from 'large-localstorage';
lls.setItem('string', 'hello world!');
// 50 Mb content
const data = new Array(50 * 1024 * 1024).fill('a').join('');
lls.setItem('large', data);
// will throw
// localStorage.setItem('large-data', data);
lls.getItem('large');
lls.removeItem('string');
lls.clear();
License
MIT@hustcc.
0.1.0
3 years ago