🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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
Version published
Weekly downloads
0
-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

cache

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