![]() |
2 years ago | |
---|---|---|
.. | ||
docs | 2 years ago | |
lib | 2 years ago | |
tests | 2 years ago | |
.jshintrc | 2 years ago | |
.travis.yml | 2 years ago | |
README.md | 2 years ago | |
bower.json | 2 years ago | |
package.json | 2 years ago |
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'
.
bower install --save localstorage-memory
npm install --save localstorage-memory
localStorageMemory.getItem('unknown') // null
localStorageMemory.setItem('foo', 123)
localStorageMemory.getItem('foo') // "123"
localStorageMemory.length // 1
localStorageMemory.key(0) // "foo"
localStorageMemory.clear()
localStorageMemory.length // 0
localStorage
API, with data being persisted at provide pathMIT