{"id":25765482,"url":"https://github.com/yayoc/fetch-as-curl","last_synced_at":"2026-05-08T04:43:03.712Z","repository":{"id":57234510,"uuid":"119530398","full_name":"yayoc/fetch-as-curl","owner":"yayoc","description":"console.log(cURL command) from Fetch API.","archived":false,"fork":false,"pushed_at":"2019-01-19T04:17:29.000Z","size":98,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T03:19:17.095Z","etag":null,"topics":["console-log","curl","fetch","npm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yayoc.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}},"created_at":"2018-01-30T12:06:04.000Z","updated_at":"2021-04-05T14:51:51.000Z","dependencies_parsed_at":"2022-09-14T12:21:13.530Z","dependency_job_id":null,"html_url":"https://github.com/yayoc/fetch-as-curl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yayoc%2Ffetch-as-curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yayoc%2Ffetch-as-curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yayoc%2Ffetch-as-curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yayoc%2Ffetch-as-curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yayoc","download_url":"https://codeload.github.com/yayoc/fetch-as-curl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240941896,"owners_count":19882116,"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":["console-log","curl","fetch","npm","typescript"],"created_at":"2025-02-26T22:19:33.821Z","updated_at":"2026-05-08T04:42:58.675Z","avatar_url":"https://github.com/yayoc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fetch-as-curl\n\nMaking [cURL](https://curl.haxx.se/) command output on browser console when using [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n\n![fetch-as-curl example](./demo.png)\n\n## Fetures\n\n* Make a cURL command on browser console.\n* Same interface with Fetch API.\n\n## Installation\n\nUsing `npm`.  \n`npm i fetch-as-curl`\n\n## Example\n\n```js\nimport \"fetch-as-curl\";\nconst options = {\n  method: \"POST\",\n  body: JSON.stringify({\n    rating: 5,\n    comment: \"cool!\"\n  }),\n  headers: {\n    Authorization: \"Bearer foo\",\n    \"Content-Type\": \"application/json\"\n  }\n}\nfetch(\"http://somesite.com/reviews\", options)\n  .then(res =\u003e /* Do something */)\n```\n\n\u003e In console\n\n```sh\ncurl -X POST -H \"Authorization: Bearer foo\" -H \"Content-Type: application/json\" -d '{\"rating\": 5, \"comment\": \"cool!\"}' http://somesite.com/some.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyayoc%2Ffetch-as-curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyayoc%2Ffetch-as-curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyayoc%2Ffetch-as-curl/lists"}