# @keeex/axios-concurrency

> Gives easy control of how many requests an axios instance makes concurrently. Useful for dealing with rate limiting. Implemented using interceptors.

Latest version **1.0.6** (published 2023-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @keeex/axios-concurrency
pnpm add @keeex/axios-concurrency
yarn add @keeex/axios-concurrency
bun add @keeex/axios-concurrency
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-09-06 |
| First published | 2023-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bernardo Wilberger |
| Maintainers | keeex_jenkins, marc-keeex, cley_faye |
| Keywords | axios, concurrency |

## Links

- npm: https://www.npmjs.com/package/@keeex/axios-concurrency
- Repository: https://devtools.keeex.me:222/KeeeX/axios-concurrency
- Homepage: https://keeex.me/oss
- npm.io page: https://npm.io/package/@keeex/axios-concurrency

## Recent versions

- 1.0.6 (latest) — 2023-09-06

## README

# Axios Concurrency Manager


Get control of concurrent requests of any [axios](https://github.com/axios/axios) instance.
Implemented using axios interceptors

## Fork information
This project was forked by KeeeX in order to fix a few issues and keep dependencies
updated.

## Installing

```bash
$ npm install axios-concurrency
```

## Example

```js
const { ConcurrencyManager } = require("axios-concurrency");
const axios = require("axios");

let api = axios.create({
  baseURL: "http://mypublicapi.com"
});

// a concurrency parameter of 1 makes all api requests secuential
const MAX_CONCURRENT_REQUESTS = 5;

// init your manager.
const manager = ConcurrencyManager(api, MAX_CONCURRENT_REQUESTS);

// requests will be sent in batches determined by MAX_CONCURRENT_REQUESTS
Promise.all(manyIds.map(id => api.get(`/test/${id}`)))
  .then(responses => {
    // ...
  });

// to stop using the concurrency manager.
// will eject the request and response handlers from your instance
manager.detach()
```

## License

MIT

---
_Source: https://npm.io/package/@keeex/axios-concurrency · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
