Socket
Socket
Sign inDemoInstall

localstorage-memory

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    localstorage-memory

localStorage-compatible API, but only stored in memory


Version published
Weekly downloads
15K
decreased by-2.9%
Maintainers
1
Install size
51.1 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 19 Nov 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc