
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
callback-chain-resolver
Advanced tools
Call bunch of functions in parallel or in series, passed via an array
Version 16 introduces series and parallel functions and removes earlier functions.
Helps you generate values out of functions in series or in parallel.
npm i callback-chain-resolver
import {series, parallel} from 'callback-chain-resolver'
const incrementBy1 = (x) => x + 1;
const decrementBy1 = (x) => x - 1;
const double = x => 2 * x
const square = x => x * x
const cube = x => x * square(x)
series(1, [incrementBy1, incrementBy1, incrementBy1]) // === 4
series(1, [incrementBy1, incrementBy1, incrementBy1, double, square]) // === 64
series(1, [incrementBy1, incrementBy1, incrementBy1, cube]) // === 64
series(1, [decrementBy1, decrementBy1, decrementBy1]) // === -2
series(1, [incrementBy1, decrementBy1]) // === 1
series(1, [incrementBy1, cube, decrementBy1]) // === 7
series(1, [decrementBy1, incrementBy1]) // === 1
parallel(1, [incrementBy1, incrementBy1, incrementBy1]) // === [2, 2, 2]
parallel(1, [incrementBy1, incrementBy1, incrementBy1, double, square]) // [2, 2, 2, 2, 1]
Check test cases for more examples.
Throws compile time error if you pass mixed output type functions.
For example when you add toString to the typedResolver test cases.
TS2345: Argument of type '(((x: number) => number) | ((x: number) => string))[]' is not assignable to parameter of type 'FnT<number>[]'.
Type '((x: number) => number) | ((x: number) => string)' is not assignable to type 'FnT<number>'.
Type '(x: number) => string' is not assignable to type 'FnT<number>'.
Type 'string' is not assignable to type 'number'
Use any in <any> while invoking mixed functions.
MIT © 2016 - 2021
FAQs
Call bunch of functions in parallel or in series, passed via an array
The npm package callback-chain-resolver receives a total of 3 weekly downloads. As such, callback-chain-resolver popularity was classified as not popular.
We found that callback-chain-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.