{"id":21879224,"url":"https://github.com/typpo/prettier-worker","last_synced_at":"2026-01-23T14:45:52.528Z","repository":{"id":137883752,"uuid":"464198821","full_name":"typpo/prettier-worker","owner":"typpo","description":"A Cloudflare Worker that formats code using prettier","archived":false,"fork":false,"pushed_at":"2022-02-27T18:06:23.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T14:59:06.331Z","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/typpo.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,"publiccode":null,"codemeta":null}},"created_at":"2022-02-27T17:02:27.000Z","updated_at":"2023-04-29T17:50:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0966030-3f52-425e-983c-927df2454a85","html_url":"https://github.com/typpo/prettier-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/typpo/prettier-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typpo%2Fprettier-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typpo%2Fprettier-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typpo%2Fprettier-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typpo%2Fprettier-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typpo","download_url":"https://codeload.github.com/typpo/prettier-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typpo%2Fprettier-worker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-28T08:15:38.430Z","updated_at":"2026-01-23T14:45:52.507Z","avatar_url":"https://github.com/typpo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## prettier-worker\n\nPrettier, hosted as a Cloudflare Worker.\n\n# Usage\n\nSend a POST request to https://prettier.ty.workers.dev.  The POST request be `application/json` encoded and the payload must look like this:\n\n```js\n{\n  \"code\": \"\u003c...your javascript code...\u003e\",\n  \"prettierOptions\": {\n    // Optional prettier API params\n  }\n}\n```\n\nThe `prettierOptions` property is optional and will accept any API override parameter documented [here](https://prettier.io/docs/en/options.html).\n\nThe response will look like this:\n\n```json\n{\n  \"code\": \"\u003c...your formatted javascript code...\u003e\"\n}\n```\n\nIf an error was thrown, the response will have a non-200 HTTP status code and probably look like this:\n\n```json\n{\n  \"error\": \"\u003c...description of error...\u003e\"\n}\n```\n\n# Examples\n\nHere's an example JSON payload that specifies some options:\n\n```json\n{\n  \"code\": \"foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());\",\n  \"prettierOptions\": {\n    \"singleQuote\": true,\n    \"semi\": true,\n    \"trailingComma\": \"all\"\n  }\n}\n```\n\nYou can test things on your command line as well (see `examples/` directory):\n\n```sh\ncurl -X POST -H 'content-type: application/json' https://prettier.ty.workers.dev -d '{\n  \"code\": \"foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());\"\n}'\n```\n\n# Supported parsers\n\nOnly the `babel` parser is supported by default due to Cloudflare limitations on bundle size.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyppo%2Fprettier-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyppo%2Fprettier-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyppo%2Fprettier-worker/lists"}