New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

secure-cache

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secure-cache

A library of cache based on memory-cache that supports Node.js.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

secure-cache

A library of cache based on memory-cache that supports Node.js.

Install

Using npm

npm install secure-cache --save

Usage

Node.js usage

const cache = require('secure-cache');
cache.get('test')//get cache data of key 'test'
cache.set('test', 123)//set cache data of key 'test', cache time is default value 3600000, unit is ms.
cache.remove('test')//remove cache data of key 'test'

Method

get cache data from memory

cache.get(key)

  • key => {String} cache key.(required)
  • return value => {Any} cache data

set cache data to memory

cache.set(key, value, time)

  • key => {String} cache key.(required)
  • value => {Any} cache data.(required)
  • time => {Number} cache time, unit is ms, default value is 3600000, that means 60 minutes.(optional)

remove cache data from memory

cache.remove(key)

  • key => {String} cache key.(required)
  • return value => {Boolean} whether the cache was removed successfully

clear all cache data from memory

cache.clear()

License

secure-cache is MIT licensed.

Keywords

FAQs

Package last updated on 12 May 2021

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