
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
coalesce inflight promise calls into a single promise
import coalescify from 'coalescify';
const fetchResource = async (id: number) => {
// ...
};
const coalescedFetchResource = coalescify(fetchResource);
const results = await Promise.all([
coalescedFetchResource(1),
coalescedFetchResource(1),
coalescedFetchResource(1),
coalescedFetchResource(3)
])
// coalescedFetchResource(1) will only be called once, and the resolved result will be shared between all other calls
// coalescedFetchResource(3) will only be called once
coalescify will automatically determine inflight calls to coalesce based on the arguments passed to the function. If the arguments are the same, the promise will be shared.
a custom coalescion key generator function can be passed as the second argument
import coalescify from 'coalescify';
const fetchResource = async (type: string, id: number) => {
// ...
};
const coalescedFetchResource = coalescify(fetchResource, (type, id) => `${type}/${id}`);
const results = await Promise.all([
coalescedFetchResource('dog', 1),
coalescedFetchResource('dog', 1),
coalescedFetchResource('dog', 2),
coalescedFetchResource('cat', 1)
])
// coalescedFetchResource('dog', 1) will be called once
// coalescedFetchResource('dog', 2) will be called once
// coalescedFetchResource('cat', 1) will be called once
using a custom coalescion key generator is generally faster, since the default implementation uses JSON.stringify on function arguments, which is slower
FAQs
coalesce inflight promise calls into a single promise
The npm package coalescify receives a total of 3 weekly downloads. As such, coalescify popularity was classified as not popular.
We found that coalescify 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.