storage-mock
v2.1.0
Published
Web Storage API Mock with events support
Downloads
1,409
Maintainers
Readme
storage-mock
Web Storage API Mock with events support
Install
$ npm install --save storage-mock
Usage
const mockedWindow = require('storage-mock');
mockedWindow.addEventListener('storage', e => {
e.key // item-key
e.oldValue // null
e.newValue // item-value
});
mockedWindow.localStorage.setItem('item-key', 'item-value');
License
MIT © Eugene Datsky