Axios

Promise-based HTTP client for the browser and Node.js with interceptors, automatic transforms, and cancellation

Library
npm
v1.20.0
109,216 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 96
Maintenance 96
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 88
Code Quality 90
Innovation 82
Learning Curve 85

Axios is the most widely used promise-based HTTP client for JavaScript, running unmodified in both browsers (via XHR/fetch) and Node.js (via the http module). It wraps the differences between these environments behind a single consistent API, so a request written once works the same way whether it executes client-side or server-side.

Beyond basic GET/POST calls, Axios provides request and response interceptors, automatic JSON serialization/deserialization, client-side XSRF protection, upload/download progress tracking, request cancellation via AbortController, and configurable instances with their own defaults. Its long history (since 2014), massive adoption (100M+ weekly downloads), and near-universal familiarity make it a default choice for teams that want a battle-tested HTTP layer without hand-rolling fetch boilerplate.

What You Get

  • A single axios instance with .get/.post/.put/.patch/.delete method aliases plus a callable axios(config) form
  • Request and response interceptor chains for adding auth headers, logging, retries, or transforming payloads centrally
  • Automatic JSON request/response transforms and automatic multipart/form-urlencoded serialization
  • Built-in request cancellation via native AbortController (and the deprecated CancelToken for legacy code)
  • Per-instance configuration via axios.create(), so different base URLs/headers/timeouts can coexist in one app
  • First-class TypeScript typings shipped in the package itself (index.d.ts / index.d.cts)
  • Upload/download progress events and client-side CSRF (XSRF) token handling out of the box

Common Use Cases

  • Calling REST/JSON APIs from a frontend SPA where fetch’s verbosity (manual JSON parsing, no built-in timeout) is a pain point
  • Sharing one HTTP client configuration (base URL, auth header, interceptor-based token refresh) across a Node.js backend service
  • Uploading files with progress bars using the onUploadProgress callback and automatic multipart/form-data handling
  • Centralizing error handling and retry logic for all outbound API calls through a single response interceptor
  • Isomorphic code that needs to issue identical HTTP requests in both a Next.js server component and the browser bundle

Under The Hood

Architecture The library is organized around lib/core/Axios.js, whose _request() method is the heart of the request pipeline: it merges the instance’s defaults with the per-call config (mergeConfig.js), flattens per-method headers into a single AxiosHeaders instance, builds an interceptor chain (InterceptorManager.js) that wraps dispatchRequest.js, and executes that chain as a promise sequence (or synchronously first if all interceptors are marked synchronous, an optimization for hot paths). dispatchRequest.js transforms the outgoing body via transformData.js, resolves the correct transport through lib/adapters/adapters.js (http.js for Node, xhr.js for browsers, fetch.js for the newer Fetch-based adapter), invokes it, and transforms the response body back. lib/axios.js is the composition root: it instantiates a default Axios instance via createInstance(), then bolts on static helpers (isCancel, CancelToken, mergeConfig, AxiosHeaders, HttpStatusCode) and the .create() factory for spinning up independently configured instances.

Tech Stack Axios is dependency-light for a library this widely used: runtime dependencies are follow-redirects (HTTP redirect handling for the Node adapter), form-data (multipart bodies in Node), https-proxy-agent, and proxy-from-env. The source is plain ES modules ("type": "module" in package.json) with no build-time framework; distribution bundles for CJS, ESM, and browser targets are produced via Rollup (rollup.config.js) and Gulp (gulpfile.js), with Babel used to transpile down for older browser targets. TypeScript typings are hand-maintained (index.d.ts/index.d.cts) rather than generated from source, since the implementation itself is plain JS.

Code Quality The test suite is substantial and organized by concern: tests/unit/core, tests/unit/adapters, tests/unit/helpers, tests/unit/cancel, and tests/unit/utils hold roughly 98 test files, run through Vitest across both a Node (‘unit’) project and a real-browser (‘browser’/‘browser-headless’) project via @vitest/browser. There’s also a dedicated tests/smoke suite that verifies the published CJS/ESM/Deno/Bun builds actually load correctly post-packaging — a good sign for a package whose main risk is bundler/runtime interop, not core logic. Error handling is deliberate rather than an afterthought: AxiosError.js implements a toJSON()-safe, circular-reference-safe config serializer with an explicit secret-redaction pass (redactConfig), and Axios.js’s request() wrapper carefully preserves and extends stack traces across the async boundary so errors thrown deep in an adapter still point back to the caller’s call site.

API Design The public surface is deliberately small and fetch-adjacent: call axios(url) or axios.get/post/put/patch/delete(url, [data], [config]), get back a promise that resolves to a normalized { data, status, headers, config } response or rejects with a typed AxiosError. Interceptors (axios.interceptors.request.use(...)) are the main extension point and read naturally as middleware. The one wrinkle for newcomers is the historical split between the legacy CancelToken cancellation API (deprecated but still present) and the modern AbortController support — the docs steer users to the latter, but both remain in the API surface for backward compatibility.

Used by 190 apps in this directory

Go
73%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

37,044

The only open-source VPS control panel with native AI agent runtime — deploy websites, Docker stacks, and local LLMs from one web interface.

View details
91
Repo Health
76
Technical
67
Dependency
Built with
Go 73%
Vue 27%
Updated 4 days ago
TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 4 days ago
Python
67%
Apache 2.0

Agent Control

AI Agents

314

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
74
Repo Health
71
Technical
67
Dependency
Built with
Python 67%
TypeScript 32%
Updated 4 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 5 days ago
Python
85%
MIT

ai-toolkit

AI Design Tools · AI Development

12,143

An all-in-one open-source training suite for finetuning diffusion models—FLUX, SDXL, Wan video, and audio—on consumer GPU hardware via CLI or web UI.

View details
79
Repo Health
66
Technical
72
Dependency
Built with
Python 85%
TypeScript 14%
Updated 5 days ago
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 89%
Updated 4 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
PHP
82%
Other

Akaunting

Invoicing Finance

10,149

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Built with
PHP 82%
Blade 13%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers