Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
promise-cache-retry
Advanced tools
[![NPM Version][npm-image]][npm-url] [![license][license-image]][license-url] [![GitHub Actions][github-image]][github-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![TypeScript Style Guide][gts-image]][gts-url] [![standard-readme compliant](http
If you simply cache the Promise it will always resolve with an error after an error occurs. On the other hand, retrying within a Promise will leave the Promise unresolved until the error is resolved, blocking further processing.
So this library works like this: If an error occurs, resolve it as an error, automatically perform retry processing (unless you disable it explicitly), and return the retry result when referencing the cache.
npm install --save promise-cache-retry
import { PromiseCache } from 'promise-cache-retry';
const cache = new PromiseCache({
promiseGenerator: async () => {
const res = await fetchData(ENDPOINT);
return res.data;
},
options: {
maxRetries: 2,
minRetryInterval: 3000,
},
});
export const handler = async () => {
const value = await cache.get();
}
PRs accepted.
Small note: If editing the Readme, please conform to the standard-readme specification.
FAQs
[![NPM Version][npm-image]][npm-url] [![license][license-image]][license-url] [![GitHub Actions][github-image]][github-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![TypeScript Style Guide][gts-image]][gts-url] [![standard-readme compliant](http
We found that promise-cache-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.