Socket
Book a DemoInstallSign in
Socket

localstoragex

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localstoragex

A localStorage polyfill for Cordova, Safari and Chrome - that just works

0.0.7
latest
Source
npmnpm
Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

LocalStorageX

LocalStorageX is a polyfill for the W3C localStorage API backed by a more reliable storage mechanism.

For one, It resolves the painful behaviour of iOS WKWebView that deletes localStorage data, without warning, and as it sees fit - making implementations using the standard localStorage API break.

At its foundation it uses the localForage project (https://github.com/localForage/localForage)

Supports

  • Browsers (Desktop Chrome, Android Chrome, iOS Safari)
  • Cordova (Android, iOS)

Install

npm i localstoragex

Use

LocalStorageX exports a singleton (static) class. Thus no instantiation is required.

import { storage } from "LocalStorageX"; 

...

await storage.init(); 
window.localStorage.override();  //true

...

Build

npm run build
npm run link

Test

npm run test

Contributing

Submit a PR or log an issue

Changelog

0.0.7

  • Clear native localStorage after loading into localStorageX

0.0.6

  • Attempts to reload (and rebind) localstoragex in the event of a localforage error due to e.g. clearing browser / app cache while app is running

0.0.4 - 0.0.5

  • Loads current localStorage (if any) into localstoragex on init
  • Init only yields once device (cordova) or document (web) is ready

0.0.1 - 0.0.3

  • Initial

FAQs

Package last updated on 13 Sep 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.