
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@jcoreio/abortable
Advanced tools
memory-leak-proof function to wrap a promise to reject when a signal is aborted
memory-leak-proof function to wrap a promise to reject when a signal is aborted
abortable(promise, signal)
Creates a promise that fulfills when the given promise
fulfills, or rejects when the given signal
is aborted,
whichever comes first. If the signal is aborted, rejects with a DOMException
with name: 'AbortError'
.
Once the returned promise resolves or rejects, references to all promise and signal handlers will have been removed, so that it doesn't unexpectedly retain any memory.
import { abortable } from '@jcoreio/abortable'
const abortController = new AbortContorller()
const { signal } = abortController
const promise = abortable(new Promise((r) => setTimeout(r, 10000)), signal)
FAQs
memory-leak-proof function to wrap a promise to reject when a signal is aborted
We found that @jcoreio/abortable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.