{"id":20518267,"url":"https://github.com/tricked-dev/doomfetch","last_synced_at":"2025-12-03T20:05:18.495Z","repository":{"id":62422258,"uuid":"401724665","full_name":"Tricked-dev/doomfetch","owner":"Tricked-dev","description":"A quick and easy fetch utlity for deno and the web using classes.","archived":false,"fork":false,"pushed_at":"2022-03-17T18:32:20.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-19T02:50:03.819Z","etag":null,"topics":["deno","javascript","typescript"],"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/Tricked-dev.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":"2021-08-31T14:02:37.000Z","updated_at":"2021-10-27T17:21:52.000Z","dependencies_parsed_at":"2022-11-01T17:33:10.430Z","dependency_job_id":null,"html_url":"https://github.com/Tricked-dev/doomfetch","commit_stats":null,"previous_names":["skyblockdev/doomfetch"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tricked-dev%2Fdoomfetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tricked-dev%2Fdoomfetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tricked-dev%2Fdoomfetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tricked-dev%2Fdoomfetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tricked-dev","download_url":"https://codeload.github.com/Tricked-dev/doomfetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242123190,"owners_count":20075344,"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":["deno","javascript","typescript"],"created_at":"2024-11-15T21:39:12.785Z","updated_at":"2025-12-03T20:05:18.429Z","avatar_url":"https://github.com/Tricked-dev.png","language":"TypeScript","readme":"# DoomFetch\n\nA simple utility to make using fetch \"easier\" using a class based approach\n\n## Tables of Contents\n\n- [DoomFetch](#doomfetch)\n\t- [Tables of Contents](#tables-of-contents)\n\t\t- [Features:](#features)\n\t\t- [Using doomFetch](#using-doomfetch)\n\t\t\t- [Simple Example](#simple-example)\n\t\t\t- [Fetching a image and getting the blob](#fetching-a-image-and-getting-the-blob)\n\t\t\t- [Sending a json body](#sending-a-json-body)\n\t\t\t- [Specifying headers](#specifying-headers)\n\t\t\t- [Sending a file](#sending-a-file)\n\t\t\t- [Retrying](#retrying)\n\t\t\t- [Clone a request](#clone-a-request)\n\t\t\t- [Changing the url path](#changing-the-url-path)\n\t\t\t- [Changing the url](#changing-the-url)\n\t\t\t- [Creating a doomfetch instance from a fetch request](#creating-a-doomfetch-instance-from-a-fetch-request)\n\t\t\t- [Using default request methods](#using-default-request-methods)\n\t- [Documentation](#documentation)\n\n### Features:\n\n- Easy to use\n- Class-Based\n- Light-Weight its just a simple wrapper around fetch\n- Supports all normal fetch apis + adding queries\n- Great typescript support types are automatically generated\n\n### Using doomFetch\n\n```ts\nimport { doomFetch } from 'https://deno.land/x/doomfetch/mod.ts';\n```\n\n#### Simple Example\n\nGet the response and return the json\n\n```ts\nimport { DenoModuleInterface } from 'somewhere.ts';\nawait doomFetch\u003cDenoModuleInterface\u003e('https://api.deno.land/modules', 'GET')\n\t.query('query', 'doomfetch')\n\t.query('limit', '1')\n\t//The json has the `DenoModuleInterface` type\n\t.json();\n```\n\n#### Fetching a image and getting the blob\n\n```ts\nawait doomFetch(\n\t'https://denolib.github.io/high-res-deno-logo/deno_hr.png'\n).send('blob');\n\n//Res.body now has the blob type and is a blob\n```\n\n#### Sending a json body\n\n```ts\nawait doomFetch('https://example.com').body({\n\tname: 'skyblockdev',\n});\n```\n\n#### Specifying headers\n\n```ts\nawait doomFetch('https://example.com')\n\t.header('Content-Type', 'application/json')\n\t.text();\n```\n\n```ts\nawait doomFetch('https://example.com')\n\t.headers({ 'Content-Type': 'application/json' })\n\t.text();\n```\n\n#### Sending a file\n\nneat shortcut that allows uploading arraybuffers/blobs/string as blob in formdata\n\n```ts\nawait doomFetch('https://example.com').file(\n\tawait Deno.readFile('file.text'),\n\t'data'\n);\n```\n\n#### Retrying\n\nEver had to deal with a api that just randomly fails?\n\n```ts\n//5 being the amount of times to retry\ndoomFetch('https://example.com').retry(5).send();\n```\n\n#### Clone a request\n\n```ts\nconst request = doomFetch('https://example.com');\nconst request2 = request.clone();\n```\n\n#### Changing the url path\n\n```ts\ndoomFetch('https://example.com/cool').setUrlPath('/404');\n```\n\n#### Changing the url\n\n```ts\ndoomFetch('https://example.com/cool').setUrl('https://youtube.com');\n```\n\n#### Creating a doomfetch instance from a fetch request\n\nYou can use the from method.\n\n```ts\nimport { DoomFetch } from 'https://deno.land/x/doomfetch/mod.ts';\nDoomFetch.from('https://example.com', {\n\tmethod: 'get',\n\tbody: JSON.stringify({\n\t\tsome: 'body',\n\t}),\n});\n```\n\nor you can set the request\n\n```ts\nconst req = doomfetch('https://example.com', 'GET').header('some', 'header');\nreq.request = {\n\theaders: {\n\t\tnewheaders: 'are here',\n\t},\n};\n```\n\n#### Using default request methods\n\nRedirect is a default thing and you can access it from doomFetch same for every other option in fetch\n\n```ts\ndoomFetch('https://example.com').redirect(false);\n```\n\n## Documentation\n\n- https://doc.deno.land/https/deno.land/x/doomfetch/mod.ts\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftricked-dev%2Fdoomfetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftricked-dev%2Fdoomfetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftricked-dev%2Fdoomfetch/lists"}