Registry / devops / axios-parallel

axios-parallel

JSON →
library1.1.2jsnpmunverified

axios-parallel is a Node.js library (v1.1.2) that uses Axios and Worker Threads to send multiple HTTP requests concurrently, leveraging multi-core CPUs for parallelism. It is designed for server-side applications only, not browsers. The library simplifies parallel request handling by managing worker pools and request distribution. Compared to other parallel request libraries, it specifically integrates with Axios and provides TypeScript types. Releases are infrequent; last update was in 2021. Its key differentiator is the use of Worker Threads for true parallelism rather than just concurrent async I/O.

npm install axios-parallel
INSTALL
IMPORT
SIG · AXIOS-PARALLEL
A
axios-parallel
devopsjavascriptv1.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

axiosParallel
import axiosParallel from 'axios-parallel'
const axiosParallel = require('axios-parallel')
CommonJS require works but TypeScript prefers default import with esModuleInterop. Default export is the main function.
AxiosParallelInput
import { AxiosParallelInput } from 'axios-parallel'
Type for the request array. Only available in TypeScript.
AxiosParallelResponse
import { AxiosParallelResponse } from 'axios-parallel'
Type for each response object. Only available in TypeScript.

Demonstrates basic usage: sending two parallel GET requests with a concurrency limit of 10.

import axiosParallel from 'axios-parallel'; (async () => { const requests = [ { method: 'GET', url: 'https://api.example.com/data1' }, { method: 'GET', url: 'https://api.example.com/data2' }, ]; try { const responses = await axiosParallel(requests, 10); console.log(responses); } catch (error) { console.error(error); } })();
Debug
Known issues
gotchaaxios-parallel uses Node.js Worker Threads and is not compatible with browser environments.
fix
Use only in Node.js projects. Do not bundle for browser.
affects: >=1.0.0
gotchaThe function expects an array of Axios request config objects, not Axios instances or URLs as strings.
fix
Pass an array of objects with axios config properties (method, url, etc.).
affects: >=1.0.0
gotchaThe response is an array of Axios response objects or errors, not a single aggregated response.
fix
Handle each response individually; check for error property in each item.
affects: >=1.0.0
deprecatedNo deprecation notices as of v1.1.2, but the package is not actively maintained (last update 2021).
fix
Consider using alternative libraries like p-limit with Axios or p-map for similar functionality.
affects: >=1.0.0
gotchaThe concurrency parameter is per CPU core, not total. The actual number of concurrent requests is concurrency * number of CPU cores.
fix
Set concurrency lower if you want to control total parallelism; it's multiplied by CPU count.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: axiosParallel is not a function
Using require() incorrectly, or default import not set up for TypeScript.
fix
Use import axiosParallel from 'axios-parallel' (with esModuleInterop) or const axiosParallel = require('axios-parallel').default.
Error: Cannot find module 'worker_threads'
Running in an environment that doesn't support Worker Threads (e.g., older Node.js versions or bundlers).
fix
Update Node.js to version >=8.10.0 and ensure not to bundle for browser.
TypeError: requests is not iterable
Passing a single object instead of an array of request configs.
fix
Wrap single request in an array: axiosParallel([{ method: 'GET', url: '...' }], concurrency).
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
axiosrequiredCore HTTP client used for making requests
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
axios-parallel — npm install axios-parallel · libregistry