new-large-localstorage
v0.1.0
Published
Safe local storage for large data.
Downloads
3
Readme
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.