mem-storage-area
A WebExtension like StorageArea in memory
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage
For testing and whatever.
Install
npm install mem-storage-area
Usage
const storage = storageonChanged await storagelocal console // { foo: 'bar' } // also storage.sync and read-only storage.managed
Advanced
You can access the Storage, StorageArea and Emitter objects:
// If you need another storage - { local, sync, managed, onChanged }const Storage = const storage = // If you need an emitterconst Emitter = const onChanged = // onChanged.addListener, onChanged.removeListener, onChanged.hasListener etc.// To emit, call onChanged(arg0, arg1...) // If you need a storage area (with optional emitter)const StorageArea = const area = name: 'myArea' onChanged readOnly: false
API
Contribute
Feel free to dive in! Open an issue or submit PRs.
License
MIT © Alan Shaw