🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

localstorage-expires

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localstorage-expires

前端localStorage设置失效时间

1.0.2
latest
npm
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

localstorage-expires

给前端localStorage设置失效时间

安装

    npm i localstorage-expires --save

使用

const storage = require('localstorage-expires');

// 设置localStorage值, key, value 对应localStorage原始setItem 参数
// expired 为失效时间 单位 秒 
storage.setItem(key, value, expired);

// 与原生localStorage.getItem(key) 使用方法一致
storage.getItem(key);

// 与原生localStorage.removeItem(key) 使用方法一致
storage.removeItem(key);

Keywords

localstorage

FAQs

Package last updated on 23 Apr 2019

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