PACKAGE · HTTP CLIENT

axios

Promise based HTTP client for the browser and node.js

WEEKLY DOWNLOADS 146.3M
STARS 109.5K
FORKS 12.1K
OPEN ISSUES 143
GZIP SIZE 22.4 kB
UNPACKED SIZE 2.2 MB
DEPENDENCIES 1
LAST UPDATED 9mo ago
DOWNLOAD TRENDS

axios downloads · last 12 months

Download trends for axios1 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.0143.9M287.8M431.7M575.6MNov 2025FebMayAugOct 2026
axios
ABOUT AXIOS

Axios is a promise-based HTTP client for browsers and Node.js. It provides a consistent way to send requests and handle responses across those environments, so application code can make HTTP calls using JavaScript promises rather than managing lower-level transport details directly.

Its design centers on an HTTP-client API that can be used in both browser and server-side JavaScript workflows. The package is intended for developers who want to make requests, wait for results with promises, and integrate network activity into existing application logic; its description identifies HTTP communication as its core role.

Axios requests return promises, allowing callers to use promise chaining or async functions to process responses and handle failures. Its API includes methods such as axios.get and axios.post, and supports a shared configuration pattern through axios.create for clients with common request settings; request and response interceptors provide points to apply logic across calls.

The browser and Node.js support lets teams use Axios in front-end applications and server-side JavaScript without switching HTTP-client APIs between those environments. Its promise-based calls can be incorporated into framework components, service modules, and other application workflows, while shared instances and interceptors can keep repeated request behavior in one place.

The supplied package data lists version 1.21.1, an MIT license, a 2.2 MB unpacked size, and a 22.4 kB gzip bundle size. The listed project figures are 143.5M weekly downloads, 109.3K GitHub stars, 12.0K forks, and 120 open issues, with a last-updated date of 2026-11-10; these figures describe the supplied snapshot, not a guarantee of behavior or maintenance cadence.

Axios handles HTTP requests, but application code still needs to decide how to structure API access and respond to failures. Its browser and Node.js support does not make their runtime constraints identical, so code that relies on environment-specific behavior should be checked in each target environment; the supplied package details do not specify a particular retry, caching, or data-fetching policy.

WHEN TO USE
  • Use axios.get or axios.post when browser or Node.js code needs to issue HTTP requests and process results through promises.
  • Use async functions with Axios calls when request results must be awaited before updating application state or continuing server-side logic.
  • Create an axios.create instance when several calls should share request configuration rather than repeating it at each call site.
  • Add request interceptors when shared logic, such as applying headers, should run before Axios sends multiple requests.
  • Add response interceptors when shared response handling or error handling should be centralized across Axios calls.
  • Use Axios when the same application needs a promise-based HTTP-client API in both browser and Node.js code.
WHEN NOT TO USE
  • Avoid Axios if the code does not make HTTP requests; use the relevant local API, such as filesystem operations in Node.js, instead.
  • Avoid Axios when a browser-only workflow is adequately served by the built-in fetch API and you want to avoid adding a separate HTTP-client dependency.
  • Avoid Axios if a Node.js workflow requires only a narrowly scoped request and the runtime’s built-in HTTP facilities are sufficient.
  • Avoid Axios when the application requires a specialized transport or protocol that an HTTP client does not provide; choose an implementation designed for that transport.
  • Avoid Axios if the project cannot accept its listed 22.4 kB gzip bundle size; evaluate a lighter approach and verify its actual bundle impact.
  • Avoid relying on Axios alone for caching, retries, or application-specific API policies; implement those policies explicitly or use a workflow that provides them.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 6
axios vs node-fetch ★ 8.8K · 298.7M/wk axios vs superagent ★ 16.6K · 33.4M/wk axios vs ky ★ 17.2K · 10.1M/wk axios vs got ★ 15.0K · 52.8M/wk axios vs undici ★ 7.8K · 347.4M/wk axios vs ofetch ★ 5.4K · 28.2M/wk