{"id":26257082,"url":"https://github.com/sunny-117/ureq","last_synced_at":"2026-04-27T19:32:42.096Z","repository":{"id":64489775,"uuid":"575910317","full_name":"Sunny-117/ureq","owner":"Sunny-117","description":"A modern, modular, and extensible HTTP request library | 模块化、可扩展的现代 HTTP 请求库","archived":false,"fork":false,"pushed_at":"2026-02-12T07:58:11.000Z","size":10847,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T03:13:55.055Z","etag":null,"topics":["fetch","http","http-client","reac-query","request","swr","xhr"],"latest_commit_sha":null,"homepage":"https://sunny-117.github.io/ureq/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sunny-117.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-08T15:18:50.000Z","updated_at":"2026-02-12T07:58:12.000Z","dependencies_parsed_at":"2024-05-05T03:23:57.457Z","dependency_job_id":"b78ffc1b-4b55-49e5-bac9-d1a5877b2915","html_url":"https://github.com/Sunny-117/ureq","commit_stats":null,"previous_names":["sunny-117/ureq"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Sunny-117/ureq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fureq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fureq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fureq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fureq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sunny-117","download_url":"https://codeload.github.com/Sunny-117/ureq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fureq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32352396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fetch","http","http-client","reac-query","request","swr","xhr"],"created_at":"2025-03-13T20:28:12.089Z","updated_at":"2026-04-27T19:32:42.086Z","avatar_url":"https://github.com/Sunny-117.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ureq - Universal HTTP Request Library\n\n[![npm version](https://badge.fury.io/js/@ureq%2Fcore.svg)](https://badge.fury.io/js/@ureq%2Fcore)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n\n\u003e 名字由来：Universal Request的简写，发音类似\"you-request\"\n\nA modern, modular, and extensible HTTP request library for JavaScript/TypeScript applications. Built with a clean architecture that supports multiple HTTP implementations and advanced features like caching, retries, interceptors, and more.\n\n## 🏗️ Architecture Overview\n\n```mermaid\ngraph TB\n    %% User Entry Points\n    User[👤 User Application]\n\n    %% Core Packages\n    Core[\"@ureq/core\u003cbr/\u003e🎯 Main Request Engine\u003cbr/\u003e• Request class\u003cbr/\u003e• Interceptors\u003cbr/\u003e• Error handling\u003cbr/\u003e• Feature composition\"]\n\n    %% Implementation Packages\n    ImplFetch[\"@ureq/impl-fetch\u003cbr/\u003e🌐 Fetch Implementation\u003cbr/\u003e• Native fetch API\u003cbr/\u003e• Browser \u0026 Node.js\u003cbr/\u003e• Lightweight\"]\n\n    ImplAxios[\"@ureq/impl-axios\u003cbr/\u003e📡 Axios Implementation\u003cbr/\u003e• Axios adapter\u003cbr/\u003e• Rich features\u003cbr/\u003e• Legacy support\"]\n\n    %% Business Layer\n    Business[\"@ureq/business\u003cbr/\u003e🏢 Business Abstractions\u003cbr/\u003e• HashService interface\u003cbr/\u003e• CacheStore interface\u003cbr/\u003e• Default implementations\"]\n\n    %% Utility Libraries\n    LibHash[\"@ureq/lib-hash\u003cbr/\u003e🔐 Hash Utilities\u003cbr/\u003e• Request hashing\u003cbr/\u003e• String hashing\u003cbr/\u003e• Deduplication\"]\n\n    LibCache[\"@ureq/lib-cache-store\u003cbr/\u003e💾 Cache Storage\u003cbr/\u003e• Memory store\u003cbr/\u003e• TTL support\u003cbr/\u003e• Storage interface\"]\n\n    %% Development \u0026 Demo\n    Playground[\"@ureq/playground\u003cbr/\u003e🎮 Demo \u0026 Testing\u003cbr/\u003e• Usage examples\u003cbr/\u003e• Feature demos\u003cbr/\u003e• Development testing\"]\n\n    Docs[\"@ureq/docs\u003cbr/\u003e📚 Documentation\u003cbr/\u003e• VitePress docs\u003cbr/\u003e• API reference\u003cbr/\u003e• Usage guides\"]\n\n    %% Dependencies\n    User --\u003e Core\n    User --\u003e ImplFetch\n    User --\u003e ImplAxios\n\n    Core --\u003e Business\n    ImplFetch --\u003e Core\n    ImplAxios --\u003e Core\n\n    Business --\u003e LibHash\n    Business --\u003e LibCache\n\n    Playground --\u003e Core\n    Playground --\u003e ImplFetch\n    Playground --\u003e ImplAxios\n    Playground --\u003e Business\n\n    Docs --\u003e Core\n    Docs --\u003e ImplFetch\n    Docs --\u003e ImplAxios\n\n    %% External Dependencies\n    ImplAxios -.-\u003e Axios[axios npm package]\n\n    %% Styling\n    classDef userEntry fill:#e1f5fe,stroke:#01579b,stroke-width:2px\n    classDef core fill:#f3e5f5,stroke:#4a148c,stroke-width:3px\n    classDef impl fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px\n    classDef business fill:#fff3e0,stroke:#e65100,stroke-width:2px\n    classDef lib fill:#fce4ec,stroke:#880e4f,stroke-width:2px\n    classDef dev fill:#f1f8e9,stroke:#33691e,stroke-width:2px\n    classDef external fill:#f5f5f5,stroke:#616161,stroke-width:1px,stroke-dasharray: 5 5\n\n    class User userEntry\n    class Core core\n    class ImplFetch,ImplAxios impl\n    class Business business\n    class LibHash,LibCache lib\n    class Playground,Docs dev\n    class Axios external\n```\n\n## 🚀 Quick Start\n\n### Installation\n\nChoose your preferred HTTP implementation:\n\n```bash\n# Option 1: Using Fetch (Recommended for modern environments)\nnpm install @ureq/core @ureq/impl-fetch\n\n# Option 2: Using Axios (For legacy support or advanced features)\nnpm install @ureq/core @ureq/impl-axios\n\n# Option 3: Install both for flexibility\nnpm install @ureq/core @ureq/impl-fetch @ureq/impl-axios\n```\n\n### Basic Usage\n\n```typescript\nimport { Request } from '@ureq/core';\nimport { FetchRequestor } from '@ureq/impl-fetch';\n\n// Create a request instance\nconst request = new Request(new FetchRequestor({\n  baseURL: 'https://jsonplaceholder.typicode.com'\n}));\n\n// Make requests\nconst user = await request.get('/todos/2');\nconst newUser = await request.post('/users', {\n  name: 'John Doe',\n  email: 'john@example.com'\n});\n```\n\n## 📦 Package Overview\n\n### Core Packages (Required)\n\n- **`@ureq/core`** - Main request engine with interceptors, error handling, and feature composition\n- **`@ureq/impl-fetch`** OR **`@ureq/impl-axios`** - Choose your HTTP implementation\n\n### Implementation Packages (Choose One)\n\n- **`@ureq/impl-fetch`** - Lightweight, uses native Fetch API (recommended)\n- **`@ureq/impl-axios`** - Feature-rich, uses Axios library\n\n### Optional Packages\n\n- **`@ureq/business`** - Business layer abstractions (auto-installed with core)\n\n## ✨ Features\n\n- 🎯 **Multiple HTTP Implementations** - Choose between Fetch or Axios\n- 🔄 **Smart Retry Logic** - Configurable retry strategies with exponential backoff\n- 💾 **Built-in Caching** - Memory cache with TTL support\n- 🚦 **Request Interceptors** - Transform requests and responses\n- ⚡ **Parallel Requests** - Concurrent request management\n- 🔒 **Request Deduplication** - Prevent duplicate requests\n- ⏱️ **Timeout Control** - Request timeout management\n- 🛡️ **Error Handling** - Comprehensive error types and handling\n- 📝 **TypeScript Support** - Full type safety and IntelliSense\n- 🎮 **Modular Design** - Use only what you need\n\n## 🛠️ Development\n\nThis project uses [Turbo](https://turbo.build/) for fast, parallel builds and [pnpm](https://pnpm.io/) for package management.\n\n### Prerequisites\n\n```bash\nnpm install -g pnpm\n```\n\n### Setup\n\n```bash\n# Install dependencies\npnpm install\n\n# Build all packages\npnpm build\n\n# Run development mode\npnpm dev\n```\n\n### Available Scripts\n\n```bash\n# Build all packages in parallel\npnpm build\n\n# Run tests\npnpm test\n\n# Lint code\npnpm lint\n\n# Format code\npnpm format\n\n# Run playground demos\npnpm demo:all\npnpm demo:basic\npnpm demo:features\npnpm demo:interceptors\npnpm demo:error-handling\n\n# Start documentation\npnpm docs:dev\n```\n\n## 📚 Documentation\n\nVisit our [documentation site](./docs) for detailed guides, API reference, and examples.\n\n## 🎮 Examples\n\nCheck out the [playground](./packages/playground) for comprehensive examples of all features.\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.\n\n## 📄 License\n\nMIT © [Your Name](./LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Fureq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunny-117%2Fureq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Fureq/lists"}