Socket
Socket
Sign inDemoInstall

storage2

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    storage2

html5 storage interface for node and browser


Version published
Weekly downloads
8.9K
increased by10.63%
Maintainers
1
Install size
6.08 kB
Created
Weekly downloads
 

Readme

Source

storage2

Build Status codecov.io

HTML5 storage interface for node and browser

  • node: simple memory storage
  • browser with storage api available: return global storage object directly (window.localStorage and window.sessionStorage)
  • browser without storage api: cookie fallback

Installation

npm install storage2 --save

Usage

var ls = require("storage2").localStorage;
var ss = require("storage2").sessionStorage;

For safari private mode, localStorage and sessionStorage will still be available globally but storage usage will cause an exception. localStorage = require('storage2').localStorage is not recommended and a different variable name like ls should always be used.

API

Web Storage API

License

ISC

Keywords

FAQs

Last updated on 23 Jun 2021

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