
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
native-abort-controller
Advanced tools
Returns native AbortController/AbortSignal if available or the abort-controller module if not
Returns native AbortController/AbortSignal if available or the abort-controller module if not
An (almost) drop-in replacement for the abort-controller
module that returns the native AbortController if available or the polyfill if not.
Some environments such as the Electron Renderer process straddle the node/browser divide with features from both APIs available. In these cases the webpack approach of always using the browser
field in your package.json
to override requires is too heavy-handed as sometimes you want to use the node version of an API.
Instead we can check for the availability of a given API and return it, rather than the node-polyfill for that API.
This module may become unecessary if mysticatea/abort-controller#24 is resolved.
You must install a version of abort-controller
alongside this module to be used if a native implementation is not available.
$ npm install --save native-abort-controller abort-controller
import { AbortController } from 'native-abort-controller'
const controller = new AbortController()
const signal = controller.signal
signal.addEventListener('abort', () => {
console.log('aborted!')
})
controller.abort()
FAQs
Returns native AbortController/AbortSignal if available or the abort-controller module if not
The npm package native-abort-controller receives a total of 25,506 weekly downloads. As such, native-abort-controller popularity was classified as popular.
We found that native-abort-controller 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.