{"id":28599874,"url":"https://github.com/un-ts/x-fetch","last_synced_at":"2025-07-15T05:33:37.892Z","repository":{"id":205927952,"uuid":"715406656","full_name":"un-ts/x-fetch","owner":"un-ts","description":"A simple but elegant `fetch` API wrapper, use `fetch` like a charm","archived":false,"fork":false,"pushed_at":"2025-06-01T01:48:28.000Z","size":3193,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T14:42:54.318Z","etag":null,"topics":["fetch","fetch-api","fetch-wrapper","fetchapi","fetcher","ifetch"],"latest_commit_sha":null,"homepage":"https://xfetch.vercel.app","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/un-ts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["JounQin","1stG","rx-ts","un-ts"],"patreon":"1stG","open_collective":"unts","custom":["https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.com/a/JounQin"]}},"created_at":"2023-11-07T04:31:00.000Z","updated_at":"2025-06-08T12:22:38.000Z","dependencies_parsed_at":"2024-01-11T20:43:12.416Z","dependency_job_id":"b4ca1ef5-623c-4fcf-b3ee-54288e1bb46d","html_url":"https://github.com/un-ts/x-fetch","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.368421052631579,"last_synced_commit":"3f8c92dbc1c9b1a78eba8de1f647a60e3b084d34"},"previous_names":["un-ts/fetch-api","un-ts/afetch"],"tags_count":11,"template":false,"template_full_name":"un-ts/lib-boilerplate","purl":"pkg:github/un-ts/x-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fx-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fx-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fx-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fx-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/un-ts","download_url":"https://codeload.github.com/un-ts/x-fetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fx-fetch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265409581,"owners_count":23760298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","fetch-api","fetch-wrapper","fetchapi","fetcher","ifetch"],"created_at":"2025-06-11T13:38:44.394Z","updated_at":"2025-07-15T05:33:37.719Z","avatar_url":"https://github.com/un-ts.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JounQin","https://github.com/sponsors/1stG","https://github.com/sponsors/rx-ts","https://github.com/sponsors/un-ts","https://patreon.com/1stG","https://opencollective.com/unts","https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.com/a/JounQin"],"categories":[],"sub_categories":[],"readme":"# x-fetch\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/un-ts/x-fetch/ci.yml?branch=main)](https://github.com/un-ts/x-fetch/actions/workflows/ci.yml?query=branch%3Amain)\n[![Codecov](https://img.shields.io/codecov/c/github/un-ts/x-fetch.svg)](https://codecov.io/gh/un-ts/x-fetch)\n[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage\u0026prefix=%E2%89%A5\u0026suffix=%\u0026query=$.typeCoverage.atLeast\u0026uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fx-fetch%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)\n[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/un-ts/x-fetch)](https://coderabbit.ai)\n[![npm](https://img.shields.io/npm/v/x-fetch.svg)](https://www.npmjs.com/package/x-fetch)\n[![GitHub Release](https://img.shields.io/github/release/un-ts/x-fetch)](https://github.com/un-ts/x-fetch/releases)\n\n[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets)\n\nA simple but elegant `fetch` API wrapper with less than `850B` minified and brotlied, use `fetch` like a charm\n\n## TOC \u003c!-- omit in toc --\u003e\n\n- [Usage](#usage)\n  - [Install](#install)\n  - [API](#api)\n- [Sponsors and Backers](#sponsors-and-backers)\n  - [Sponsors](#sponsors)\n  - [Backers](#backers)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Usage\n\n### Install\n\n```sh\n# npm\nnpm i x-fetch\n\n# yarn\nyarn add x-fetch\n\n# pnpm\npnpm add x-fetch\n\n# bun\nbun add x-fetch\n```\n\n### API\n\n```ts\nimport { ApiMethod, createXFetch, interceptors, xfetch } from 'x-fetch'\n\n// plain url, GET method\nawait xfetch('url')\n\n// with options, `method`, `body`, `query`, etc.\nawait xfetch('url', {\n  method: ApiMethod.POST, // or 'POST'\n  // plain object or array, or BodyInit\n  body: {},\n  // URLSearchParametersOptions\n  query: {\n    key: 'value',\n  },\n  // json: boolean, // whether auto stringify body to json, default true for plain object or array, otherwise false\n  // type: 'arrayBuffer' | 'blob' | 'json' | 'text' | null, `null` means plain `Response`\n})\n\nconst interceptor: ApiInterceptor = (req, next) =\u003e {\n  // do something with req\n  const res = await next(req)\n  // do something with res\n  return res\n}\n\n// add interceptor\ninterceptors.use(interceptor)\n\n// remove interceptor\ninterceptors.eject(interceptor)\n\n// create a new isolated `xfetch` with its own `interceptors`\nconst { xfetch, interceptors } = createXFetch()\n```\n\n## Sponsors and Backers\n\n[![Sponsors and Backers](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)\n\n### Sponsors\n\n| 1stG                                                                                                                   | RxTS                                                                                                                   | UnTS                                                                                                                   |\n| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |\n\n### Backers\n\n| 1stG                                                                                                                | RxTS                                                                                                                | UnTS                                                                                                                |\n| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective backers](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |\n\n## Changelog\n\nDetailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).\n\n## License\n\n[MIT][] © [JounQin][]@[1stG.me][]\n\n[1stG.me]: https://www.1stG.me\n[JounQin]: https://github.com/JounQin\n[MIT]: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fx-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fun-ts%2Fx-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fx-fetch/lists"}