
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
multi-signal
Advanced tools
Merges multiple AbortSignals into a single signal. returned signal will be aborted if any of the input signals are aborted.
Merge multiple AbortSignals into a single signal
AbortSignal()
in any function/utility.AbortController().signal
and AbortSignal.timeout()
![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
Using npm:
$ npm install multi-signal
Using yarn:
$ yarn add multi-signal
Once the package is installed, you can import
the function:
import multiSignal from 'multi-signal';
You can also use require
:
const multiSignal = require('multi-signal');
import multiSignal from 'multi-signal';
// signals
const controller1 = new AbortController();
const controller2 = new AbortController();
const signal1 = controller1.signal;
const signal2 = controller2.signal;
const timeoutSignal = AbortSignal.timeout(2000);
// signals as separate arguments
const signal = multiSignal(signal1, signal2);
// signals as array
const signal = multiSignal([signal1, signal2]);
// different signal types
const signal = multiSignal(signal1, signal2, timeoutSignal);
import multiSignal from 'multi-signal';
const controller1 = new AbortController();
const signal = controller1.signal;
const timeoutSignal = AbortSignal.timeout(2000); // 2 sec
fetch('url', { signal: multiSignal(signal, timeoutSignal) })
import multiSignal from 'multi-signal';
const controller1 = new AbortController();
const controller2 = new AbortController();
const signal1 = controller1.signal;
const signal2 = controller1.signal;
axios.get('url', {
timeout: 2000, // 2 sec
signal: multiSignal(signal1, signal2)
})
import multiSignal from 'multi-signal';
const controller = new AbortController();
const signal = controller.signal;
const timeoutSignal = AbortSignal.timeout(2000); // 2 sec
X.addEventListener('event', (e) => { ... }, {
signal: multiSignal(signal, timeoutSignal)
})
Note: You can use as many AbortSignals as you want in any order.
MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal].
By default, Node.js has maximum listener limit of 10
. you can increase the limit depending on your use case:
import events from 'events';
events.setMaxListeners(100);
Inspired by: Proposal: fetch with multiple AbortSignals
FAQs
Merges multiple AbortSignals into a single signal. returned signal will be aborted if any of the input signals are aborted.
The npm package multi-signal receives a total of 17 weekly downloads. As such, multi-signal popularity was classified as not popular.
We found that multi-signal 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.