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

node-memo

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-memo

An in-memory cache module.

  • 0.0.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

node-memo

An in-memory cache module.

API

  • new MemoryCache(maxAge)
  • instance
    • this.maxAgenumber
    • this.maxAge
    • this.get(key)*
    • this.set(key, value)
    • this.has(key)boolean
    • this.keys()Iterator
    • this.values()Iterator
    • this.time(key)number
    • this.clear()
  • static

new MemoryCache(maxAge)

Create a cache.

ParamTypeDescription
maxAgenumberThe max age of the cache.

this.maxAge ⇒ number

Get the max age of the cache.

Kind: instance property of MemoryCache

this.maxAge

Set the max age of the cache.

Kind: instance property of MemoryCache

ParamTypeDescription
newAgenumberThe new max age of the cache.

this.get(key) ⇒ *

Get the value for the specified key in the cache.

Kind: instance method of MemoryCache

ParamTypeDescription
key*The key tied to the data in the cache.

this.set(key, value)

Set a key and value in the cache.

Kind: instance method of MemoryCache

ParamTypeDescription
key*The key tied to the value in the cache.
value*The value tied to the key in the cache.

this.has(key) ⇒ boolean

Check if a key-value pair exists in the cache.

Kind: instance method of MemoryCache

ParamTypeDescription
key*The specified key in the cache.

this.keys() ⇒ Iterator

Get the keys in the cache.

Kind: instance method of MemoryCache

this.values() ⇒ Iterator

Get the values in the cache.

Kind: instance method of MemoryCache

this.time(key) ⇒ number

Get the current time of a cached item.

Kind: instance method of MemoryCache

ParamTypeDescription
key*The specified key in the cache.

this.clear()

Clear the cache.

Kind: instance method of MemoryCache

MemoryCache.Second ⇒ number

Get 1 second in milliseconds.

Kind: static property of MemoryCache

MemoryCache.Minute ⇒ number

Get 1 minute in milliseconds.

Kind: static property of MemoryCache

MemoryCache.Hour ⇒ number

Get 1 hour in milliseconds.

Kind: static property of MemoryCache

MemoryCache.Day ⇒ number

Get 1 day in milliseconds.

Kind: static property of MemoryCache

Author

Kazi Jawad

FAQs

Package last updated on 03 Oct 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