{"id":17358917,"url":"https://github.com/muke1908/fetch22","last_synced_at":"2026-03-08T08:39:57.462Z","repository":{"id":57234728,"uuid":"280688663","full_name":"muke1908/fetch22","owner":"muke1908","description":"a wrapper to use fetch more efficiently and easily.","archived":false,"fork":false,"pushed_at":"2024-08-31T13:42:13.000Z","size":251,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-15T06:41:40.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/muke1908.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}},"created_at":"2020-07-18T15:53:10.000Z","updated_at":"2020-07-19T14:19:53.000Z","dependencies_parsed_at":"2022-09-15T06:50:43.706Z","dependency_job_id":null,"html_url":"https://github.com/muke1908/fetch22","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muke1908%2Ffetch22","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muke1908%2Ffetch22/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muke1908%2Ffetch22/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muke1908%2Ffetch22/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muke1908","download_url":"https://codeload.github.com/muke1908/fetch22/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219842781,"owners_count":16556524,"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-10-15T19:07:31.673Z","updated_at":"2026-03-08T08:39:57.423Z","avatar_url":"https://github.com/muke1908.png","language":"TypeScript","readme":"A lightweight wrapper to use fetch more efficiently and easily and with better error handling, and this is promisified!\n\n![Size](https://badgen.net/bundlephobia/minzip/fetch-req)\n![Types](https://badgen.net/npm/types/fetch-req)\n![Downloads](https://badgen.net/npm/dt/fetch-req)\n\n\n---\n\n## Basic usage:\n\n[![Edit tender-field-22tkq](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/tender-field-22tkq?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n\nimport from CDN\n```\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/fetch-req\"\u003e\u003c/script\u003e\n```\n\nOr from NPM,\n\n```\nimport fetch from 'fetch-req';\n```\n\n```\nconst someFunction = async ()=\u003e {\n  const respGET = await fetch.get('http://dummy.restapiexample.com/api/v1/employees');\n  const respPOST = await fetch.post('http://dummy.restapiexample.com/api/v1/employees', { \n    'dummyData': 'Mukesh'\n  })\n}\n```\n\n## Additional methods:\n**1. Poll** - call an endpoint and handle response in interval.  \n```\nconst endpoint = () =\u003e fetch.get('http://dummy.restapiexample.com/api/v1/employees');\n\nconst poll = fetch.poll(endpoint, callback, 1000);\npoll.pause();                // Pause polling\npoll.resume();               // Resume polling\npoll.updateInterval(1000);  // Update the interval, set it to 1000ms\n```\n\n**Note:** This doesn't use `setInterval`, and it **prevents the race conditions** because, it makes the next call exactly after given time(in ms) \nfrom the time last response received.\n\n**2. Retry** - Retry no of times in case request fails.  \n```\nconst resp = await fetch.retry(3).get('http://dummy.restapiexample.com/api/v1/employees');\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuke1908%2Ffetch22","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuke1908%2Ffetch22","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuke1908%2Ffetch22/lists"}