{"id":14156361,"url":"https://github.com/hemanth/curl-to-fetch","last_synced_at":"2025-04-15T07:31:12.058Z","repository":{"id":66173560,"uuid":"56971719","full_name":"hemanth/curl-to-fetch","owner":"hemanth","description":"Parse curl commands and returns `fetch` API equivalent.","archived":false,"fork":false,"pushed_at":"2017-11-19T11:34:07.000Z","size":7,"stargazers_count":25,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T18:21:24.231Z","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/hemanth.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}},"created_at":"2016-04-24T13:01:34.000Z","updated_at":"2024-01-12T20:13:19.000Z","dependencies_parsed_at":"2023-07-06T19:00:28.335Z","dependency_job_id":null,"html_url":"https://github.com/hemanth/curl-to-fetch","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"f29865d2982b956921f95185b496191ae7779d04"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fcurl-to-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fcurl-to-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fcurl-to-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fcurl-to-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemanth","download_url":"https://codeload.github.com/hemanth/curl-to-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249026737,"owners_count":21200499,"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-08-17T08:05:24.543Z","updated_at":"2025-04-15T07:31:11.724Z","avatar_url":"https://github.com/hemanth.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"\n# curl-to-fetch\n\nParse curl commands and returns `fetch` API equivalent.\n\n## Example\n\nInput:\n\n```\ncurl --cookie 'species=sloth;type=galactic' slothy https://api.sloths.com\n```\n\nOutput:\n\n```js\nfetch( \n      'https://api.sloths.com', \n      {headers:{\"Set-Cookie\":\"species=sloth;type=galactic\"},\n      method:'GET'}\n     )\n     .then(console.log, console.error)\n```\n\nP.S: Supports all the `curl` flags that [parse-curl.js](https://www.npmjs.org/parse-curl/) has.\n\n##CLI\n\n```sh\n$ c2f \"curl --cookie 'species=sloth;type=galactic' slothy https://api.sloths.com\"\n```\n\n```sh\n      fetch( \n            https://api.sloths.com, \n            {headers:{\"Set-Cookie\":\"species=sloth;type=galactic\"},\n            method:'GET'}\n           )\n           .then(console.log, console.error)\n```\n\n#API\n\n```js\n\nconst parse = require('curl-to-fetch');\n\nconst fetchCode = parse(`curl 'http://google.com/'`);\n\nconsole.log(fetchCode);\n\n```\n\n## Badges\n\n![](https://img.shields.io/badge/license-MIT-blue.svg)\n![](https://img.shields.io/badge/status-stable-green.svg)\n\n---\n\n\u003e [h3manth.com](https://h3manth.com) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e GitHub [@hemanth](https://github.com/hemanth) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter [@gnumanth](https://twitter.com/gnumanth)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemanth%2Fcurl-to-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemanth%2Fcurl-to-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemanth%2Fcurl-to-fetch/lists"}