Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@interaction/storage

Package Overview
Dependencies
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interaction/storage

`npm i --save @interaction/storage` ### 使用 `import storage from '@interaction/storage';` ### API #### setItem(key, value[, time]) - **key**: string - **value**: string - **time**: Date|number|string,过期时间,如果取值时间大于该值,将自动删除,并返回null, 可选

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
6
Weekly downloads
 
Created
Source

Storage

安装

npm i --save @interaction/storage

使用

import storage from '@interaction/storage';

API

setItem(key, value[, time])
  • key: string
  • value: string
  • time: Date|number|string,过期时间,如果取值时间大于该值,将自动删除,并返回null, 可选
storage.setItem('key1', 'value1')
storage.setItem('key2', 'value2', new Date())
getItem(key) :获取指定key值对应的value值
  • key: string
storage.getItem('key1')
removeItem(key) :清除指定的key值和对应的value值
  • key: string
storage.removeItem('key1')
clear() :清空已存储的值
  • key: string
storage.clear()

FAQs

Package last updated on 05 Jun 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc