Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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.51
import 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 healthy version release cadence and project activity because the last version was released less than 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.