{"id":16058365,"url":"https://github.com/scmmishra/pup","last_synced_at":"2026-07-04T04:33:21.526Z","repository":{"id":142375688,"uuid":"613279810","full_name":"scmmishra/pup","owner":"scmmishra","description":"A tiny (\u003e 1kb) pupper that fetches for you","archived":false,"fork":false,"pushed_at":"2023-04-12T11:27:18.000Z","size":1140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-17T19:43:36.710Z","etag":null,"topics":["ajax","browser","fetch","rest","rest-api","tiny"],"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/scmmishra.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-13T09:07:47.000Z","updated_at":"2024-02-20T07:55:00.000Z","dependencies_parsed_at":"2023-07-21T20:32:59.875Z","dependency_job_id":null,"html_url":"https://github.com/scmmishra/pup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scmmishra/pup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmmishra%2Fpup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmmishra%2Fpup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmmishra%2Fpup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmmishra%2Fpup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scmmishra","download_url":"https://codeload.github.com/scmmishra/pup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmmishra%2Fpup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35110268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ajax","browser","fetch","rest","rest-api","tiny"],"created_at":"2024-10-09T03:21:06.498Z","updated_at":"2026-07-04T04:33:21.516Z","avatar_url":"https://github.com/scmmishra.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cp\u003e\n  \u003cimg src=\".github/pupper.webp\" style=\"height: 150px;\"\u003e\n  \u003ch1\u003epup-fetch\u003c/h1\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n![DeepSource](https://deepsource.io/gh/scmmishra/pup.svg/?label=active+issues\u0026show_trend=true\u0026token=_HAIDwNbi1ocMhaBKxB_BcSQ)\n![DeepSource](https://deepsource.io/gh/scmmishra/pup.svg/?label=resolved+issues\u0026show_trend=true\u0026token=_HAIDwNbi1ocMhaBKxB_BcSQ)\n![Less than 400B](https://deno.bundlejs.com/?q=pup-fetch\u0026badge)\n\n  \u003cp\u003eA tiny (370B) pupper that fetches for you, pup is a slim wrapper around fetch\u003c/p\u003e\n\n\u003c/div\u003e\n\n## Installation\n\n```sh\npnpm install pup-fetch\n```\n\n```sh\nnpm install pup-fetch\n```\n\n```sh\nyarn install pup-fetch\n```\n\n## Usage\n\nImport the methods you need from the module:\n\n```js\nimport { get, post } from \"pup-fetch\";\n```\n\n### GET Requests\n\nMake a GET request using the get method:\n\n```ts\nconst response = await get\u003cMyResponseType\u003e(\"/api/my-endpoint\");\n```\n\nThe `get` method takes two arguments: the `path` to the endpoint and an optional configuration object. The configuration object can include a `baseUrl` property to specify a base URL to prepend to the endpoint path.\n\n### POST Requests\n\nMake a POST request using the post method:\n\n```ts\nconst body = { name: \"John Doe\", email: \"john.doe@example.com\" };\nconst response = await post\u003cMyResponseType\u003e(\"/api/my-endpoint\", body);\n```\n\nThe `post` method takes three arguments: the `path` to the endpoint, the request `body`, and an optional configuration object. Like with `get`, the configuration object can include a `baseUrl` property.\n\n### Configuration\n\nThe `RequestConfig` interface defines the configuration options for HTTP requests. The following properties are available:\n\n- `baseUrl`: The base URL to prepend to the endpoint path.\n- `method`: The HTTP method to use (e.g. GET, POST, PUT, DELETE).\n- `headers`: An object containing HTTP headers to include in the request.\n- `body`: The request body, as a string or an object that can be serialized to JSON.\n- `mode`: The request mode, which can be \"cors\", \"no-cors\", \"same-origin\", or \"navigate\".\n- `cache`: The cache mode, which can be \"default\", \"no-store\", \"reload\", \"no-cache\", \"force-cache\", or \"only-if-cached\".\n- `redirect`: The redirect mode, which can be \"follow\", \"error\", or \"manual\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscmmishra%2Fpup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscmmishra%2Fpup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscmmishra%2Fpup/lists"}