
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
promise-dedup
Advanced tools
Deduplicate any promise.
By default, dedup caches promises until they are settled:
import { dedup } from "promise-dedup";
async function doStuff() {
await new Promise((resolve) => setTimeout(resolve, 5000)); // Waiting five seconds
return 5;
}
dedup(doStuff, ["key", 42]);
dedup(doStuff, ["key", 42]);
dedup(doStuff, ["key", 42]);
// doStuff is only called once at this point
await new Promise((resolve) => setTimeout(resolve, 6000)); // Waiting six seconds
dedup(doStuff, ["key", 42]); // doStuff is called again because the previous promise settled
The third optional argument of dedup is the stale policy. By default, it's "settled".
It can be set to "never" or to a number. When set to "never", the promise never gets stale.
When set to a number, the promise gets stale after a timeout of that number as milliseconds.
FAQs
Deduplicate any promise
The npm package promise-dedup receives a total of 327 weekly downloads. As such, promise-dedup popularity was classified as not popular.
We found that promise-dedup 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.