🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

localstorage-memory

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
l

localstorage-memory

localStorage-compatible API, but only stored in memory

1.0.3
latest
92

Supply Chain Security

100

Vulnerability

78

Quality

76

Maintenance

100

License

Version published
Weekly downloads
10K
2.23%
Maintainers
1
Weekly downloads
 
Created
Issues
1

localstorage-memory

localStorage-compatible API, but only stored in memory

Build Status

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

License

MIT

FAQs

Package last updated on 19 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts