{"id":47106,"library":"axios-throttled","title":"axios-throttled","description":"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.","status":"maintenance","version":"2.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/a-chepugov/axios-throttled","tags":["javascript","js","axios","throttle"],"install":[{"cmd":"npm install axios-throttled","lang":"bash","label":"npm"},{"cmd":"yarn add axios-throttled","lang":"bash","label":"yarn"},{"cmd":"pnpm add axios-throttled","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for HTTP requests","package":"axios","optional":false},{"reason":"Underlying throttling utility","package":"throttled-async","optional":false}],"imports":[{"note":"Library exports a single constructor function, not a default export. CommonJS only, no ESM.","wrong":"import AxiosT from 'axios-throttled';","symbol":"AxiosT","correct":"const AxiosT = require('axios-throttled');"},{"note":"Must be instantiated with 'new'.","wrong":"AxiosT(config) without new","symbol":"AxiosT instance","correct":"const axiosT = new AxiosT(config);"},{"note":"Returns a Promise; requires await or .then().","wrong":"axiosT.requestRaw() without 'await'","symbol":"requestRaw","correct":"await axiosT.requestRaw(config);"}],"quickstart":{"code":"const AxiosT = require('axios-throttled');\n\nconst config = {\n  query: 'https://jsonplaceholder.typicode.com/posts',\n  stay: () => Date.now() % 2 === 0, // only allow requests on even milliseconds\n  logs: 3 // number of requests before throttling\n};\n\nconst axiosT = new AxiosT(config);\n\nasync function run() {\n  try {\n    const data = await axiosT.request({params: {userId: 1}});\n    console.log('Data length:', data.length);\n  } catch (err) {\n    console.error(err);\n  }\n}\n\nrun();","lang":"javascript","description":"Demonstrates creating an AxiosT instance with throttling configuration, making a throttled request, and handling the response or error."},"warnings":[{"fix":"Use require() instead of import.","message":"Library uses CommonJS only; ESM imports will fail.","severity":"breaking","affected_versions":"*"},{"fix":"Check for undefined return or use requestRaw() which always returns axios response.","message":"If stay function returns true, request() returns undefined (not a rejected promise).","severity":"gotcha","affected_versions":"*"},{"fix":"Consider migrating to axios-rate-limit or custom interceptor.","message":"Library is unmaintained since 2019; axios peer dependency may become incompatible.","severity":"deprecated","affected_versions":"*"},{"fix":"Always provide a query (URL string or axios config object).","message":"Constructor expects config object with 'query' property as string or object; missing query throws error.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'2.1.2':18 '2019':76 'around':8 'axio':2,9,26,61,65,87 'axios-throttl':1 'base':35 'basic':78 'block':33 'commit':74 'condit':49 'config':66 'creat':4 'custom':38 'design':59 'esm':83 'featur':80 'function':40 'general':53 'http':15 'integr':63 'javascript':85 'js':86 'last':73 'latest':21 'librari':55,68 'limit':11,47 'make':41 'mechan':30 'minim':70 'modern':82 'offer':77 'rate':13,46 'rate-limit':45 'releas':23 'request':16,34,50 'specif':58 'stabl':22 'stay':39 'support':84 'suppress':51 'throttl':3,6,29,54,79,88 'unlik':52 'unmaintain':72 'use':43 'version':17 'without':81 'wrap':25 'wrapper':7","created_at":"2026-06-07T16:49:49.369679+00:00","updated_at":"2026-06-07T16:49:49.369679+00:00","problems":[{"fix":"Use const AxiosT = require('axios-throttled');\nconst axiosT = new AxiosT(config);","cause":"Using ESM import on a CommonJS default export.","error":"TypeError: AxiosT is not a constructor"},{"fix":"Ensure AxiosT is instantiated with 'new' and config.query is valid.","cause":"Calling request without awaiting constructor or using instance before async init.","error":"TypeError: Cannot read property 'request' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/a-chepugov/axios-throttled#readme","github":"https://github.com/a-chepugov/axios-throttled","docs":null,"changelog":null,"pypi":null,"npm":"axios-throttled","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}