Socket
Book a DemoInstallSign in
Socket

browser-localstorage-expire

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-localstorage-expire

package for manage localstorage browser

1.8.1
latest
Source
npmnpm
Version published
Weekly downloads
31
93.75%
Maintainers
1
Weekly downloads
 
Created
Source

browser-localStorage

npm
version

Installation

npm i -S browser-localstorage-expire
yarn add browser-localstorage-expire

Usage

module for manage cache from localstorage with expiration

Returns:

methods getItem and saveItem


Example

const localCache = browserLocalstorage();

browserLocalstorage~getItem(name) ⇒

function for get data in localstorage

Kind: inner method of browserLocalstorage
Returns:

data from localstorage

ParamTypeDescription
namestring

name key for localstorage

Example

const localCache = browserLocalstorage();
localCache.localGetItem('data')

browserLocalstorage~setItem(name, value, [expiry]) ⇒

function for save data in localstorage

Kind: inner method of browserLocalstorage
Returns:

void

ParamTypeDefaultDescription
namestring

name key for localstorage

value*

data to save in localstorage

[expiry]number5

time of expiration in minutes

Example

const localCache = browserLocalstorage();
localCache.setItem('data', [{ country: 2 }], 5);

Keywords

browser

FAQs

Package last updated on 16 Oct 2022

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.