
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@azure/abort-controller
Advanced tools
The @azure/abort-controller package provides AbortSignalLike interface and
AbortError classes to make it easier to work with the
AbortController
and the AbortSignal used by
fetch built into modern JavaScript platforms.
Customers of Azure SDK for JavaScript in general do not need to use this library. Instead they
use AbortController and AbortSignal provided by their platforms and pass the abort signals to Azure SDK operations.
Key links:
Install this library using npm as follows
npm install @azure/abort-controller
Use AbortController to create an AbortSignal which can then be passed to Azure SDK operations to cancel
pending work. The AbortSignal can be accessed via the signal property on an instantiated AbortController.
An AbortSignal can also be returned directly from a static method, e.g. AbortSignal.timeout(100).
that is cancelled after 100 milliseconds.
The below examples assume that doAsyncWork is a function that takes a bag of properties, one of which is
of the abort signal.
async function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {
if (options.abortSignal.aborted) {
return;
}
// do async work
}
const controller = new AbortController();
doAsyncWork({ abortSignal: controller.signal });
// at some point later
controller.abort();
async function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {
if (options.abortSignal.aborted) {
return;
}
// do async work
}
const signal = AbortSignal.timeout(1000);
doAsyncWork({ abortSignal: signal });
You can build and run the tests locally by executing npm run test. Explore the test folder to see advanced usage and behavior of the public classes.
If you run into issues while using this library, please feel free to file an issue.
If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.
The 'abort-controller' package provides a similar API for creating abortable operations using AbortController and AbortSignal. It is a polyfill for the AbortController interface that works in both web browsers and Node.js environments. Compared to @azure/abort-controller, it is not specific to Azure SDKs and can be used in a wider range of applications.
FAQs
Microsoft Azure SDK for JavaScript - Aborter
The npm package @azure/abort-controller receives a total of 20,952,172 weekly downloads. As such, @azure/abort-controller popularity was classified as popular.
We found that @azure/abort-controller demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.