Registry / devops / axios-throttled

axios-throttled

JSON →
library2.1.2jsnpmunverified

Creates a throttling wrapper around axios to limit the rate of HTTP requests. Version 2.1.2 is the latest stable release. It wraps axios with a throttling mechanism that can block requests based on a custom stay function, making it useful for rate-limiting or conditional request suppression. Unlike general throttling libraries, it is specifically designed for axios and integrates with axios configs. The library is minimal and unmaintained (last commit in 2019), offering basic throttling features without modern ESM support.

npm install axios-throttled
INSTALL
IMPORT
SIG · AXIOS-THROTTLED
A
axios-throttled
devopsjavascriptv2.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.

AxiosT
const AxiosT = require('axios-throttled');
import AxiosT from 'axios-throttled';
Library exports a single constructor function, not a default export. CommonJS only, no ESM.
AxiosT instance
const axiosT = new AxiosT(config);
AxiosT(config) without new
Must be instantiated with 'new'.
requestRaw
await axiosT.requestRaw(config);
axiosT.requestRaw() without 'await'
Returns a Promise; requires await or .then().

Demonstrates creating an AxiosT instance with throttling configuration, making a throttled request, and handling the response or error.

const AxiosT = require('axios-throttled'); const config = { query: 'https://jsonplaceholder.typicode.com/posts', stay: () => Date.now() % 2 === 0, // only allow requests on even milliseconds logs: 3 // number of requests before throttling }; const axiosT = new AxiosT(config); async function run() { try { const data = await axiosT.request({params: {userId: 1}}); console.log('Data length:', data.length); } catch (err) { console.error(err); } } run();
Debug
Known issues
breakingLibrary uses CommonJS only; ESM imports will fail.
fix
Use require() instead of import.
affects: *
gotchaIf stay function returns true, request() returns undefined (not a rejected promise).
fix
Check for undefined return or use requestRaw() which always returns axios response.
affects: *
deprecatedLibrary is unmaintained since 2019; axios peer dependency may become incompatible.
fix
Consider migrating to axios-rate-limit or custom interceptor.
affects: *
gotchaConstructor expects config object with 'query' property as string or object; missing query throws error.
fix
Always provide a query (URL string or axios config object).
affects: *
Errors
Common errors & fixes
TypeError: AxiosT is not a constructor
Using ESM import on a CommonJS default export.
fix
Use const AxiosT = require('axios-throttled');
const axiosT = new AxiosT(config);
TypeError: Cannot read property 'request' of undefined
Calling request without awaiting constructor or using instance before async init.
fix
Ensure AxiosT is instantiated with 'new' and config.query is valid.
Upgrade
Version history
2.1.2latest on npm
Audit
Dependencies
axiosrequiredPeer dependency for HTTP requests
throttled-asyncrequiredUnderlying throttling utility
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
axios-throttled — npm install axios-throttled · libregistry