AI Skill Hub 推荐使用:Fetcher 是一款优质的AI工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
Fetcher 是一款基于 TypeScript 开发的开源工具,专注于 axios、client、event-source 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Fetcher 是一款基于 TypeScript 开发的开源工具,专注于 axios、client、event-source 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g fetcher # 方式二:npx 直接运行(无需安装) npx fetcher --help # 方式三:项目依赖安装 npm install fetcher # 方式四:从源码运行 git clone https://github.com/Ahoo-Wang/fetcher cd fetcher npm install npm start
# 命令行使用
fetcher --help
# 基本用法
fetcher [options] <input>
# Node.js 代码中使用
const fetcher = require('fetcher');
const result = await fetcher.run(options);
console.log(result);
# fetcher 配置说明 # 查看配置选项 fetcher --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export FETCHER_CONFIG="/path/to/config.yml"
Ultra-lightweight • Modular • TypeScript-First • Interceptor-Powered • LLM Streaming API Support
pnpm install
```shell
npm install @ahoo-wang/fetcher
npm install @ahoo-wang/fetcher @ahoo-wang/fetcher-decorator @ahoo-wang/fetcher-eventbus @ahoo-wang/fetcher-eventstream @ahoo-wang/fetcher-cosec
npm install -g @ahoo-wang/fetcher-generator
pnpm build
pnpm clean
import { Fetcher } from '@ahoo-wang/fetcher';
// Create a fetcher instance
const fetcher = new Fetcher({
baseURL: 'https://api.example.com',
timeout: 5000,
});
// GET request with path and query parameters
const response = await fetcher.get('/users/{id}', {
urlParams: {
path: { id: 123 },
query: { include: 'profile' },
},
});
const userData = await response.json<User>();
// POST request with automatic JSON conversion
const createUserResponse = await fetcher.post('/users', {
body: { name: 'John Doe', email: 'john@example.com' },
});
import { NamedFetcher } from '@ahoo-wang/fetcher';
import {
api,
get,
post,
path,
query,
body,
} from '@ahoo-wang/fetcher-decorator';
// Register a named fetcher
const apiFetcher = new NamedFetcher('api', {
baseURL: 'https://api.example.com',
});
// Define service with decorators
@api('/users', { fetcher: 'api' })
class UserService {
@get('/')
getUsers(@query('limit') limit?: number): Promise<User[]> {
throw autoGeneratedError(limit);
}
@post('/')
createUser(@body() user: User): Promise<User> {
throw autoGeneratedError(user);
}
@get('/{id}')
getUser(@path('id') id: number): Promise<User> {
throw autoGeneratedError(id);
}
}
// Use the service
const userService = new UserService();
const users = await userService.getUsers(10);
```shell
Explore comprehensive, production-ready implementations in our integration-test directory:
A lightweight, cross-environment storage library with key-based storage and automatic environment detection:
Transform your API interactions with clean, declarative service definitions:
A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the Wow Domain-Driven Design framework, providing native support for the CQRS architectural pattern.
Type-safe OpenAI API client with native streaming support for chat completions:
fetcher-generator generate -i ./openapi-spec.json -o ./src/generated
The lightweight core that powers the entire ecosystem:
- ⚡ Ultra-Lightweight: Only 3KiB min+gzip - smaller than most alternatives - 🧭 Path & Query Parameters: Built-in support for path ({id}/:id) and query parameters - 🔗 Interceptor System: Request, response, and error interceptors with ordered execution for flexible middleware patterns - ⏱️ Timeout Control: Configurable request timeouts with proper error handling - 🔄 Fetch API Compatible: Fully compatible with the native Fetch API - 🛡️ TypeScript Support: Complete TypeScript definitions for type-safe development - 🧩 Modular Architecture: Lightweight core with optional extension packages - 📦 Named Fetcher Support: Automatic registration and retrieval of fetcher instances - ⚙️ Default Fetcher: Pre-configured default fetcher instance for quick start
A TypeScript event bus library providing multiple implementations for handling events: serial execution, parallel execution, and cross-tab broadcasting.
Power your real-time applications with Server-Sent Events support, specially designed for Large Language Model streaming APIs:
- 📡 Event Stream Conversion: Converts text/event-stream responses to async generators of ServerSentEvent objects - 🔌 Side-Effect Module Import: Automatically adds eventStream() and jsonEventStream() methods to the global Response.prototype for responses with text/event-stream content type - 📋 SSE Parsing: Parses Server-Sent Events according to the specification, including data, event, id, and retry fields - 🔄 Streaming Support: Handles chunked data and multi-line events correctly - 💬 Comment Handling: Properly ignores comment lines (lines starting with :) as per SSE specification - 🛡️ TypeScript Support: Complete TypeScript type definitions - ⚡ Performance Optimized: Efficient parsing and streaming for high-performance applications - 🤖 LLM Streaming Ready: Native support for streaming responses from popular LLM APIs like OpenAI GPT, Claude, etc.
First-class integration with the Wow CQRS/DDD framework:
- 🔄 CQRS Pattern Implementation: First-class support for Command Query Responsibility Segregation architectural pattern - 🧱 DDD Primitives: Essential Domain-Driven Design building blocks including aggregates, events, and value objects - 📦 Complete TypeScript Support: Full type definitions for all Wow framework entities including commands, events, and queries - 📡 Real-time Event Streaming: Built-in support for Server-Sent Events to receive real-time command results and data updates - 🚀 Command Client: High-level client for sending commands to Wow services with both synchronous and streaming responses - 🔍 Powerful Query DSL: Rich query condition builder with comprehensive operator support for complex querying - 🔍 Query Clients: Specialized clients for querying snapshot and event stream data with comprehensive query operations: - Counting resources - Listing resources - Streaming resources as Server-Sent Events - Paging resources - Retrieving single resources
Secure your applications with integrated authentication:
| Package | Description | Version | Size |
|---|---|---|---|
[@ahoo-wang/fetcher](./packages/fetcher) | **Core HTTP Client**<br/>Ultra-lightweight foundation with Axios-like API | [](https://www.npmjs.com/package/@ahoo-wang/fetcher) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher) |
[@ahoo-wang/fetcher-decorator](./packages/decorator) | **Decorator Support**<br/>Declarative API service definitions | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-decorator) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-decorator) |
[@ahoo-wang/fetcher-eventstream](./packages/eventstream) | **Real-Time Streaming & LLM Support**<br/>Server-Sent Events (SSE) support with native LLM streaming API integration | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventstream) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventstream) |
[@ahoo-wang/fetcher-openai](./packages/openai) | **OpenAI Client**<br/>Type-safe OpenAI API client with streaming support for chat completions | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-openai) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-openai) |
[@ahoo-wang/fetcher-generator](./packages/generator) | **OpenAPI Code Generator**<br/>Powerful TypeScript code generator from OpenAPI specifications, designed to be general-purpose with specialized support for Wow domain-driven design framework's CQRS patterns | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-generator) | |
[@ahoo-wang/fetcher-openapi](./packages/openapi) | **OpenAPI TypeScript Types**<br/>Complete TypeScript type definitions for OpenAPI 3.0+ specifications | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-openapi) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-openapi) |
[@ahoo-wang/fetcher-storage](./packages/storage) | **Cross-Environment Storage**<br/>Lightweight storage library with key-based storage and automatic environment detection | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-storage) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-storage) |
[@ahoo-wang/fetcher-react](./packages/react) | **React Integration**<br/>React hooks and components for seamless data fetching with automatic re-rendering | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-react) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-react) |
[@ahoo-wang/fetcher-wow](./packages/wow) | **CQRS/DDD Framework Support**<br/>First-class integration with the Wow CQRS/DDD framework | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-wow) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-wow) |
[@ahoo-wang/fetcher-cosec](./packages/cosec) | **Enterprise Security**<br/>CoSec authentication integration | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-cosec) | [](https://www.npmjs.com/package/@ahoo-wang/fetcher-cosec) |
#pnpm test:it ```
Fetcher 是一个轻量级且功能强大的 HTTP 客户端工具库,旨在为开发者提供高效、现代化的网络请求解决方案。它不仅具备极高的性能,还针对现代 Web 开发场景进行了深度优化,是构建高性能应用的基础组件。
Fetcher 支持强大的实时通信功能,原生支持 Large Language Models (LLM) 的 Streaming API,能够流畅处理流式响应。通过集成 Server-Sent Events (SSE) 技术,实���实时通知与数据更新,并具备自动重连机制,确保 Streaming Data 在网络波动时依然保持连续性。
在使用 Fetcher 之前,请确保您的开发环境已安装 Node.js(版本需 >= 16)以及 pnpm(版本需 >= 8)。在开始项目开发前,请务必检查环境版本以避免兼容性问题。
您可以通过 npm 包管理器快速安装 Fetcher 的核心包。只需在您的项目根目录下运行 `npm install @ahoo-wang/fetcher` 即可完成安装。如果是从源码进行开发,建议使用 `pnpm install` 来安装所有必要的依赖。
Fetcher 提供了简洁直观的 API 使用方式。您可以轻松创建一个 Fetcher 实例,并利用其内置的路径参数(path parameters)和查询参数(query parameters)功能发起请求。同时,项目目录下的 integration-test 文件夹提供了大量生产级别的集成测试示例,供开发者参考学习。
本项目包含一个轻量级的跨环境存储库 `@ahoo-wang/fetcher-storage`。它支持在浏览器 localStorage/sessionStorage 与 in-memory 存储之间无缝切换,具备自动环境检测功能,且体积极小(仅约 1KB gzip),并支持监听 Storage Change Events。
Fetcher 生态提供了丰富的扩展工具:`@ahoo-wang/fetcher-decorator` 支持通过声明式装饰器定义 HTTP 服务,实现参数自动绑定与超时控制;`@ahoo-wang/fetcher-generator` 则是一个强大的 TypeScript 代码生成工具,可基于 OpenAPI 规范自动生成类型安全的 API 客户端代码,并针对 Wow DDD 框架进行了深度优化。
Fetcher 采用模块化设计:核心模块 `@ahoo-wang/fetcher` 是整个生态的基石,体积仅 3KiB (min+gzip),支持路径参数解析及完善的 Interceptor 系统;`@ahoo-wang/fetcher-eventbus` 则提供了一个高性能的 TypeScript 事件总线,支持串行、并行及跨标签页(cross-tab)广播等多种事件处理模式。
Fetcher是一个功能强大的HTTP客户端生态系统
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,Fetcher 是一款质量良好的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | fetcher |
| 原始描述 | 开源AI工具:Fetcher is not just another HTTP client—it's a complete ecosystem designed for m。⭐15 · TypeScript |
| Topics | axiosclientevent-sourceevent-streamtypescript |
| GitHub | https://github.com/Ahoo-Wang/fetcher |
| License | Apache-2.0 |
| 语言 | TypeScript |
收录时间:2026-05-29 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。