{"id":14984114,"url":"https://github.com/prettier/parse-srcset","last_synced_at":"2025-10-19T11:31:46.970Z","repository":{"id":60195674,"uuid":"309340475","full_name":"prettier/parse-srcset","owner":"prettier","description":"A spec-conformant JavaScript parser for the HTML5 srcset attribute","archived":false,"fork":false,"pushed_at":"2023-07-07T05:58:13.000Z","size":935,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T15:15:10.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ikatyang/parse-srcset","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettier.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}},"created_at":"2020-11-02T10:50:06.000Z","updated_at":"2024-06-28T03:18:51.000Z","dependencies_parsed_at":"2023-09-24T05:25:35.313Z","dependency_job_id":null,"html_url":"https://github.com/prettier/parse-srcset","commit_stats":{"total_commits":50,"total_committers":6,"mean_commits":8.333333333333334,"dds":0.52,"last_synced_commit":"c5594a45f587029b43d9b422dfc0bad6bfd2b175"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fparse-srcset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fparse-srcset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fparse-srcset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fparse-srcset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettier","download_url":"https://codeload.github.com/prettier/parse-srcset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237117165,"owners_count":19258364,"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-09-24T14:08:28.669Z","updated_at":"2025-10-19T11:31:46.517Z","avatar_url":"https://github.com/prettier.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @prettier/parse-srcset\n\nThis repository is a fork of https://github.com/albell/parse-srcset for [Prettier](https://github.com/prettier/prettier).\n\n---\n\nA javascript parser for the [HTML5 srcset](http://www.w3.org/TR/html-srcset/) attribute, based on the [WHATWG reference algorithm](https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute). It has an extensive test suite based on the [W3C srcset conformance checker](http://w3c-test.org/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html).\n\n## Installation\n\n```bash\nyarn add @prettier/parse-srcset\n```\n\n## Usage\n\n```js\nimport parseSrcset from \"@prettier/parse-srcset\";\n\nparseSrcset('elva-fairy-320w.jpg, elva-fairy-480w.jpg 1.5x, elva-fairy-640w.jpg 2x');\n/*\n[\n  { source: { value: 'elva-fairy-320w.jpg', startOffset: 0 } },\n  {\n    source: { value: 'elva-fairy-480w.jpg', startOffset: 21 },\n    density: { value: 1.5 }\n  },\n  {\n    source: { value: 'elva-fairy-640w.jpg', startOffset: 47 },\n    density: { value: 2 }\n  }\n]\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettier%2Fparse-srcset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettier%2Fparse-srcset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettier%2Fparse-srcset/lists"}