Socket
Socket
Sign inDemoInstall

browser-localstorage-expire

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    browser-localstorage-expire

package for manage localstorage browser


Version published
Weekly downloads
89
decreased by-7.29%
Maintainers
1
Install size
12.3 kB
Created
Weekly downloads
 

Changelog

Source

[1.8.1] - 2022-10-16

Fixed

  • Fix generic type in getItem method

Readme

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

FAQs

Last updated on 16 Oct 2022

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