localstorage-memory
v1.0.3
Published
localStorage-compatible API, but only stored in memory
Downloads
66,402
Readme
localstorage-memory
localStorage-compatible API, but only stored in memory
localStorageMemory
provides all methods that localStorage
in browsers
provides, but no data is persisted, it's only stored in memory. It can
be used as a drop-in replacement, the only exception being the
Associative array syntax localStorage['myKey'] = 'myValue'
.
Download or Installation
- Download localstorage-memory.js
- or: install via Bower:
bower install --save localstorage-memory
- or: install via npm:
npm install --save localstorage-memory
Usage
localStorageMemory.getItem('unknown') // null
localStorageMemory.setItem('foo', 123)
localStorageMemory.getItem('foo') // "123"
localStorageMemory.length // 1
localStorageMemory.key(0) // "foo"
localStorageMemory.clear()
localStorageMemory.length // 0
Related
- https://github.com/lmaccherone/node-localstorage
provides a
localStorage
API, with data being persisted at provide path
License
MIT