Skip to content

@ureqUniversal Request Library

模块化、可扩展的现代 HTTP 请求库 | A modern, modular, and extensible HTTP request library

@ureq logo

快速安装 | Quick Installation

bash
npm install @ureq/core @ureq/impl-fetch
bash
pnpm add @ureq/core @ureq/impl-fetch
bash
yarn add @ureq/core @ureq/impl-fetch

简单示例 | Simple Example

typescript
import { Request } from '@ureq/core';
import { FetchRequestor } from '@ureq/impl-fetch';

// 创建请求实例
const request = new Request(new FetchRequestor({
  baseURL: 'https://api.example.com'
}));

// 发起请求
const data = await request.get('/users/1');
console.log(data);

为什么选择 @ureq? | Why @ureq?

🎨 模块化设计

核心功能与具体实现分离,按需引入所需模块,保持应用轻量。

🔧 高度可扩展

轻松添加自定义请求器、拦截器和功能模块。

🚀 开箱即用

内置常用功能如重试、缓存、超时等,无需额外配置。

💪 类型安全

完整的 TypeScript 支持,享受智能提示和类型检查。

Released under the MIT License.