{"id":13459186,"url":"https://github.com/matthew-andrews/isomorphic-fetch","last_synced_at":"2025-05-14T22:05:21.588Z","repository":{"id":22961497,"uuid":"26311302","full_name":"matthew-andrews/isomorphic-fetch","owner":"matthew-andrews","description":"Isomorphic WHATWG Fetch API, for Node \u0026 Browserify","archived":false,"fork":false,"pushed_at":"2024-06-27T10:34:24.000Z","size":59,"stargazers_count":6949,"open_issues_count":56,"forks_count":287,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-05-14T22:03:19.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/matthew-andrews.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}},"created_at":"2014-11-07T08:46:13.000Z","updated_at":"2025-05-08T13:35:36.000Z","dependencies_parsed_at":"2022-07-10T17:18:33.344Z","dependency_job_id":"47af9edf-1750-4e6b-b063-30e1dea07709","html_url":"https://github.com/matthew-andrews/isomorphic-fetch","commit_stats":{"total_commits":73,"total_committers":13,"mean_commits":5.615384615384615,"dds":"0.17808219178082196","last_synced_commit":"fc5e0d0d0b180e5b4c70b2ae7f738c50a9a51b25"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthew-andrews%2Fisomorphic-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthew-andrews%2Fisomorphic-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthew-andrews%2Fisomorphic-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthew-andrews%2Fisomorphic-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthew-andrews","download_url":"https://codeload.github.com/matthew-andrews/isomorphic-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235686,"owners_count":22036962,"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":[],"created_at":"2024-07-31T09:01:09.234Z","updated_at":"2025-05-14T22:05:21.565Z","avatar_url":"https://github.com/matthew-andrews.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Repository","24. 前后端交互"],"sub_categories":["HTTP","24.1 Ajax模块"],"readme":"isomorphic-fetch [![Build Status](https://travis-ci.org/matthew-andrews/isomorphic-fetch.svg?branch=master)](https://travis-ci.org/matthew-andrews/isomorphic-fetch)\n================\n\nFetch for node and Browserify.  Built on top of [GitHub's WHATWG Fetch polyfill](https://github.com/github/fetch).\n\n## Warnings\n\n- This adds `fetch` as a global so that its API is consistent between client and server.\n\nFor [ease-of-maintenance and backward-compatibility reasons][why polyfill], this library will always be a polyfill. As a \"safe\" alternative, which does not modify the global, consider [fetch-ponyfill][].\n\n[why polyfill]: https://github.com/matthew-andrews/isomorphic-fetch/issues/31#issuecomment-149668361\n[fetch-ponyfill]: https://github.com/qubyte/fetch-ponyfill\n\n## Why Use Isomorphic Fetch\n\nThe Fetch API is currently [not implemented consistently](http://caniuse.com/#search=fetch) across browsers. This module will enable you to use `fetch` in your Node code in a cross-browser compliant fashion. The Fetch API is part of the Web platform API defined by the standards bodies WHATWG and W3C.\n\n## Installation\n\n### NPM\n\n```sh\nnpm install --save isomorphic-fetch\n```\n\n### Bower\n\n```sh\nbower install --save isomorphic-fetch\n```\n\n## Usage\n\n```js\nrequire('isomorphic-fetch');\n\nfetch('//offline-news-api.herokuapp.com/stories')\n\t.then(function(response) {\n\t\tif (response.status \u003e= 400) {\n\t\t\tthrow new Error(\"Bad response from server\");\n\t\t}\n\t\treturn response.json();\n\t})\n\t.then(function(stories) {\n\t\tconsole.log(stories);\n\t});\n```\n\n## License\n\nAll open source code released by FT Labs is licenced under the MIT licence.  Based on [the fine work by](https://github.com/github/fetch/pull/31) **[jxck](https://github.com/Jxck)**.\n\n## Alternatives\n\n- [cross-fetch](https://github.com/lquixada/cross-fetch#why-not-isomorphic-fetch)\n- Using [node-fetch](https://github.com/node-fetch/node-fetch) and the [Fetch polyfill](https://github.com/github/fetch) directly (or from [polyfill.io](https://polyfill.io), or relying on [the browser's implementation of the Fetch API](https://caniuse.com/fetch)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthew-andrews%2Fisomorphic-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthew-andrews%2Fisomorphic-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthew-andrews%2Fisomorphic-fetch/lists"}