{"id":26709399,"url":"https://github.com/js-bits/fetch","last_synced_at":"2025-04-13T17:32:50.158Z","repository":{"id":57122337,"uuid":"380597414","full_name":"js-bits/fetch","owner":"js-bits","description":"Cross-environment (nodejs/web) fetch API","archived":false,"fork":false,"pushed_at":"2023-07-19T03:09:19.000Z","size":911,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T08:16:44.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/js-bits.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}},"created_at":"2021-06-26T21:15:37.000Z","updated_at":"2023-07-03T17:56:08.000Z","dependencies_parsed_at":"2024-06-21T17:32:29.369Z","dependency_job_id":"66e55757-2ee7-436c-a778-553e762abb96","html_url":"https://github.com/js-bits/fetch","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bits%2Ffetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bits%2Ffetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bits%2Ffetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bits%2Ffetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bits","download_url":"https://codeload.github.com/js-bits/fetch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752391,"owners_count":21156081,"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":"2025-03-27T08:16:47.140Z","updated_at":"2025-04-13T17:32:50.136Z","avatar_url":"https://github.com/js-bits.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross-environment (nodejs/web) fetch APi\n\nThis package exports `window.fetch` object in a browser and [node-fetch](https://www.npmjs.com/package/node-fetch) module in a Node.js environment. Which is helpful when you develop a package compatible with both environments and use `fetch` for HTTP requests. Allows to avoid conditional imports.\n\n## Installation\n\nInstall with npm:\n\n```\nnpm install @js-bits/fetch\n```\n\nInstall with yarn:\n\n```\nyarn add @js-bits/fetch\n```\n\nImport where you need it:\n\n```javascript\nimport fetch from '@js-bits/fetch';\n```\n\nor require for CommonJS:\n\n```javascript\nconst fetch = require('@js-bits/fetch');\n```\n\n## How to use\n\n```javascript\nfetch('http://example.com/movies.json')\n  .then(response =\u003e response.json())\n  .then(data =\u003e console.log(data));\n```\n\n## Notes\n\n- The package versions are aligned with [node-fetch](https://www.npmjs.com/package/node-fetch) versions.\n- [version 2](https://www.npmjs.com/package/@js-bits/fetch/v/2.0.0) of this package supports [version 2](https://github.com/node-fetch/node-fetch/tree/2.x#readme) of [node-fetch](https://www.npmjs.com/package/node-fetch).\n- Minimal size (bytes) in a browser since [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) is natively supported. Does not include any polyfills.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bits%2Ffetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bits%2Ffetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bits%2Ffetch/lists"}