JSPM

axios-request-throttle

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4035
  • Score
    100M100P100Q131813F
  • License MIT

Utility for rate-limiting axios requests

Package Exports

  • axios-request-throttle

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (axios-request-throttle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

axios-request-throttle

Throttle axios request-per-second rate with 3 lines of code. The main difference with this module and others like axios-throttled is that you don't have to create a new axios instance, and by extension don't have to fix imports project-wide. Apply once and every axios.get, post, put, delete etc is throttled.

Installation

yarn add axios-request-throttle

or

npm i axios-request-throttle

Usage

import axios from 'axios';
import axiosThrottle from 'axios-request-throttle';

axiosThrottle.use(axios, { requestsPerSecond: 5 });