Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing
npm install node-storage-shim

node-storage-shim provides a simple shim conforming to the w3c Storage Interface
that can be used as a transient replacement for localStorage or sessionStorage
when running in environments that do not support these, eg: node.
Note that this does not persist it's data to disk, and is primarily aimed at
use in unit tests.
``shell script`
npm install --save node-storage-shim
`javascript
const StorageShim = require('node-storage-shim')
storage = new StorageShim()
storage.setItem("foo", "My Value")
console.log(storage.getItem("foo")
`
Polyfill localStorage / sessionStorage
If you wish to polyfill the localStorage and sessionStorage globals that are available in
web browsers, you can do something like this:
`javascript
const StorageShim = require('node-storage-shim')
global.window = global
global.localStorage = new StorageShim()
global.sessionStorage = new StorageShim()
``
npm install
npm test
- storage event portion of the interface is not implemented.