
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
Simple AbortController wrapper that makes it easy to nest signals
$ npm i abortabort
See the tests for more usage examples than what is below.
A few things of note:
actualSuccessRatio < successRatioLimit, so if you have two dependants, and you set the
value to 0.5, it will not abort. If you want to set it to abort, you should set it to 0.51import AbortAbort from 'abortabort'
const abortChild1 = new AbortAbort({ id: 'abortChild1' })
const abortChild2 = new AbortAbort({ id: 'abortChild2' })
/**
* abortExample1 will abort on the first of any of these events:
* * 15 seconds passes
* * abortChild1 aborts (successRatio will be 0.50)
*/
const abortExample1 = new AbortAbort({ id: 'abortExample1', dependants: [abortChild1, abortChild2], timeout: 15000, successRatioLimit: 0.51 })
Set this to 0 to fail an AbortAbort anytime one of it's children aborts.
import AbortAbort from 'abortabort'
const abortChild1 = new AbortAbort({ id: 'abortChild1' })
const abortChild2 = new AbortAbort({ id: 'abortChild2' })
const abortChild3 = new AbortAbort({ id: 'abortChild3', dependants: [abortChild1], maximumFailedDependants: 0})
/**
* abortExample1 will abort on the first of any of these events:
* * 15 seconds passes
* * abortChild3 aborts (maximumFailedDependants >= 0)
* * abortChild1 aborts (it will cause abortChild3 to abort)
*/
const abortExample2 = new AbortAbort({ id: 'abortExample2', dependants: [abortChild1, abortChild2], maximumFailedDependants: 0 })
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Simple AbortController wrapper that makes it easy to nest signals
We found that abortabort 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.