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

job-cache

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

job-cache

A job queue that caches the job's result

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

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

job-cache

A job queue that caches the job's result

Installation

$ npm i -S job-cache

Usage

const createCache = require('job-cache');
const cache = createCache();

// Adding a job with a cooldown (won't reschedule additional jobs with the same
// key if the cooldown is still in effect - counted from the job's finish time)
cache.add({
    key: 'foo',
    action: () => Promise.resolve('result'),
    cooldown: 1500
});

// Returns the last-run job's result.
cache.get('foo');

// Returns the entire cache ({key: result})
cache.getAll();

FAQs

Package last updated on 28 Nov 2018

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