storage-mock

Web Storage API Mock with events support

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
storage-mock
2.1.03 years ago7 years agoMinified + gzip package size for storage-mock in KB

Readme

storage-mock Build Status
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