alovajs/alova

TypeScriptalova.js.org

The request strategy layer for JavaScript. 20+ ready-made strategies cut your request code by up to 70%

hookstypescriptvuejsxmlhttprequestreactjssvelteaxiosfetch-apirequestalovasuperagentajax
Croissance des étoiles
Étoiles
4k
Forks
148
Croissance hebdomadaire
+-2
Issues
6
2k4k
nov. 2022févr. 2024mai 2025sept. 2026
Artefactsnpm
README

Stop building request logic. Start shipping features.
The request strategy layer for JavaScript — cut your request code by up to 70%.

English | 中文 | 日本語

Documentation | Demos

npm build coverage status stars discord wechat tree shaking typescript strategies license

Sponsors

Thanks to these generous sponsors for supporting alova's development.

watchthis.dev      worma

What is alova?

alova (pronounced /əˈləʊva/) is the request strategy layer for JavaScript. You've hand-written pagination, forms, uploads and retries countless times — now just pick one of 20+ ready-made request strategies and cut your request code by up to 70%.

You don't have to throw away the axios or fetch you already know. alova sits right on top of your existing request library and takes over the logic you keep rewriting. One API set spans React, Vue, Svelte, Solid, mini-programs and the server — learn once, use everywhere, so you can focus on business logic on both the client and the server.

Here is a paginated list with prefetch, auto-cache and auto-sync on create/update/delete — about five lines of code:

const todoList = (page, size) => alova.Get('/api/todos', { params: { page, size } });

const { loading, data, page, pageSize, pageCount, total } = usePagination(todoList);
// auto pagination · prefetch next page · auto cache sync on create/update/delete

Features

Instead of listing what alova "is", here's what it solves for you:

The boilerplate you're tired of What alova gives you The payoff
Hand-writing pagination, forms, uploads, SSE states usePagination / useForm / useUploader / useSSE Up to 70% less boilerplate
Server-side rate limiting & retries (incl. distributed) alova/server Capabilities React Query / SWR simply don't cover
Rebuilding the same logic for every framework One API set Spans React / Vue / Svelte / Solid / mini-programs
Manually maintaining cache invalidation Multi-level cache (L1/L2) + declarative invalidation via hitSource Cache invalidation is no longer painful
Copy-pasting API info between docs and your editor worma API hints & docs show up right inside your editor

And of course:

  • Easy to use, watch the video to get started in 5 mins.
  • Full compatibility with your favorite HTTP clients and UI frameworks.
  • 20+ high-performance request strategies (business modules) for building faster apps.
  • Request sharing and response cache to improve app performance.
  • End-to-end type safety.
  • Advanced OpenAPI solution worma: from one OpenAPI spec, generate type-safe calling code, TypeScript types, full API docs, and API knowledge for your AI coding assistant.

When should you use alova?

alova is honest about where it shines — and where a simpler tool is enough:

Your situation Recommendation
Simple CRUD + caching React Query / SWR are enough
Complex admin / forms / pagination / uploads ✅ alova is clearly a step ahead
Cross-platform (Web + mini-program / uni-app / Taro) ✅ One API set covers everything
Server-side request governance (rate limit / retry / distributed) ✅ alova is almost the only choice
OpenAPI → type-safe code + AI-friendly API knowledge ✅ Pair with worma (works out of the box with alova)

Not sure alova is right for you? Read When should you NOT use alova? for the honest reverse list before you commit.

Is there any difference?

Unlike libraries such as @tanstack/react-query, swrjs, and ahooks's useRequest, alova aims to make API integration very easy and efficient, while maintaining more efficient data interaction and bringing a smoother experience to users.

For the same paginated list, React Query needs roughly 25 lines while alova's usePagination takes about 5 — see the no-BS comparison.

You can also check Comparison with other request libraries to learn more about the differences of alova.

Join the community

We need your support

If you like alova, we are very grateful for giving us a star in the upper right corner, which is a recognition and encouragement for our work.

Welcome to contribute

We are honored to receive active participation from developers around the world in Issues and Discussions.

We hope to make alova a common project for everyone who is willing to participate. We encourage everyone to become a contributor to the alova community with an open and inclusive attitude. Even if you are a junior developer, as long as your ideas meet the development guidelines of alova, please participate generously.

Effective contributions will win you a certain reputation in the Alova community. Before contributing, please be sure to read the Contribution Guide in detail to ensure your contribution is effective.

Changelog

Link

Contributors

LICENSE

MIT

Dépôts similaires
pmndrs/zustand

🐻 Bear necessities for state management in React

TypeScriptnpmMIT Licensehooksreact
zustand-demo.pmnd.rs
58.7k2.2k
TanStack/query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

TypeScriptnpmMIT Licensereacthooks
tanstack.com/query
50.3k4.2k
typicode/husky

Git hooks made easy 🐶 woof!

JavaScriptnpmMIT Licensegithooks
typicode.github.io/husky
35.3k1.1k
jaredpalmer/formik

Build forms in React, without the tears 😭

TypeScriptnpmApache License 2.0reactforms
formik.org
34.3k2.8k
vercel/swr

React Hooks for Data Fetching

TypeScriptnpmMIT Licensereacthook
swr.vercel.app
32.5k1.4k
mantinedev/mantine

A fully featured React components library

TypeScriptnpmMIT Licensereacttypescript
mantine.dev
31.7k2.4k
TanStack/table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

TypeScriptnpmMIT Licensereacttable
tanstack.com/table
28.4k3.6k
adnanh/webhook

webhook is a lightweight incoming webhook server to run shell commands

GoGo ModulesMIT Licensewebhookgo
12.1k875
uidotdev/usehooks

A collection of modern, server-safe React hooks – from the ui.dev team

MDXMIT Licensereacthooks
usehooks.com
11.5k586
rehooks/awesome-react-hooks

Awesome React Hooks

awesomeCreative Commons Zero v1.0 Universalreacthooks
10.3k771
pmndrs/drei

🥉 useful helpers for react-three-fiber

JavaScriptnpmMIT Licensethreejsreact-three-fiber
docs.pmnd.rs/drei
9.9k837
pmndrs/use-gesture

👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.

TypeScriptnpmMIT Licensegestureshooks
use-gesture.netlify.app
9.6k334