Socket
Socket
Sign inDemoInstall

cachenow

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cachenow

cachenow is package to easily cache any data for a specifiy time


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Install size
5.38 kB
Created
Weekly downloads
 

Readme

Source

Cachenow

cachenow is a package to easily cache any type of data for a specific time. It works like a Map with a specific TTL for each entry.

Install

npm install cachenow

Usage

import CacheNow from 'cachenow';

const animalWeights = new CacheNow<number>(40 * 1000);

animalWeights.set('dog', 50); // Key = Value

animalWeights.get('dog') // returns 50

setTimeout(() => {
  animalWeights.get('dog') // returns null
}, 50 * 1000)

Todo

  • Delete key from cache
  • Add option to save cache in a specific file
    • new CacheNow(5 * 1000, 'storage.json')

Keywords

FAQs

Last updated on 24 Aug 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc