{"id":18901364,"url":"https://github.com/xiaohuohumax/x-fetch","last_synced_at":"2026-02-23T00:02:10.345Z","repository":{"id":257820705,"uuid":"870608033","full_name":"xiaohuohumax/x-fetch","owner":"xiaohuohumax","description":"一个基于 fetch API 的简单、轻量级的 HTTP 请求库。","archived":false,"fork":false,"pushed_at":"2024-11-04T13:16:21.000Z","size":255,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T18:18:32.019Z","etag":null,"topics":["endpoint","fetch-api","http","request","x-fetch"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaohuohumax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-10-10T10:53:55.000Z","updated_at":"2025-04-01T18:13:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"9bdbc9f6-d524-4a71-ab64-7d68519c986c","html_url":"https://github.com/xiaohuohumax/x-fetch","commit_stats":null,"previous_names":["xiaohuohumax/x-fetch"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/xiaohuohumax/x-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohuohumax%2Fx-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohuohumax%2Fx-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohuohumax%2Fx-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohuohumax%2Fx-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaohuohumax","download_url":"https://codeload.github.com/xiaohuohumax/x-fetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohuohumax%2Fx-fetch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29731683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: 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":["endpoint","fetch-api","http","request","x-fetch"],"created_at":"2024-11-08T08:55:54.118Z","updated_at":"2026-02-23T00:02:10.280Z","avatar_url":"https://github.com/xiaohuohumax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# x-fetch\n\n[![Version](https://img.shields.io/npm/v/@xiaohuohumax/x-fetch.svg?sanitize=true)](https://www.npmjs.com/package/@xiaohuohumax/x-fetch)\n[![License](https://img.shields.io/npm/l/@xiaohuohumax/x-fetch.svg?sanitize=true)](https://www.npmjs.com/package/@xiaohuohumax/x-fetch)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/xiaohuohumax/x-fetch/release-publish.yaml)](https://github.com/xiaohuohumax/x-fetch/actions/workflows/release-publish.yaml)\n\n一个基于 fetch API 的简单、轻量级的 HTTP 请求库。\n\n\u003e [!NOTE]\n\u003e 此项目由 [octokit](https://github.com/octokit) [[MIT](https://github.com/xiaohuohumax/x-fetch/blob/main/licenses/octokit.js/LICENSE)] 项目修改而来，移除了对 Github API 相关的支持，只保留了通用的 fetch 功能。\n\n## 📖 详细文档\n\n[**详细文档**](./packages/x-fetch/README.md)\n\n## 🚀 快速开始\n\n**安装：**\n\n```shell\nnpm install @xiaohuohumax/x-fetch\n```\n\n**使用：**\n\n```typescript\nimport { XFetch } from \"@xiaohuohumax/x-fetch\"\n\nconst xFetch = new XFetch({\n  baseUrl: \"https://api.github.com\",\n  params: {\n    owner: \"octokit\",\n    repo: \"request.js\",\n  }\n})\n\n// 请求 Hook 示例\nxFetch.request.hook.before(\"request\", (options) =\u003e {\n  console.log(\"before request\", options)\n})\n\n// 方式一\nxFetch.request({\n  url: \"/repos/{owner}/{repo}/issues{?page,per_page}\",\n  method: \"GET\",\n  params: {\n    page: 1,\n    per_page: 1,\n  }\n}).then(console.log).catch(console.error)\n\n// 方式二\nxFetch.request(\"GET /repos/{owner}/{repo}/issues{?page,per_page}\", {\n  params: {\n    page: 1,\n    per_page: 1,\n  }\n}).then(console.log).catch(console.error)\n```\n\n## 📚 使用示例\n\n+ [x-fetch vue-demo](./examples/vue/)\n+ [x-fetch node-demo](./examples/node/)\n+ [x-fetch 基本用法](./examples/x-fetch/)\n+ [x-fetch 核心功能](./examples/x-fetch-core/)\n+ [x-fetch endpoint](./examples/x-fetch-endpoint/)\n+ [x-fetch request](./examples/x-fetch-request/)\n+ [x-fetch 插件模板](./packages/plugins/plugin-template/)\n\n## 📄 License\n\n[MIT](LICENSE)\n\n最后：玩的开心 🎉🎉🎉🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohuohumax%2Fx-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaohuohumax%2Fx-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohuohumax%2Fx-fetch/lists"}