{"id":13407888,"url":"https://github.com/badges/svg-to-image-proxy","last_synced_at":"2025-03-14T12:31:48.754Z","repository":{"id":34977699,"uuid":"173644195","full_name":"badges/svg-to-image-proxy","owner":"badges","description":"Web function to generate PNGs from SVGs","archived":true,"fork":false,"pushed_at":"2023-02-05T15:39:22.000Z","size":656,"stargazers_count":17,"open_issues_count":10,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-31T20:28:26.649Z","etag":null,"topics":["image","png","proxy","rasterizer","svg"],"latest_commit_sha":null,"homepage":"https://raster.shields.io/badge/foo-bar-blue.png","language":"JavaScript","has_issues":false,"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/badges.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"open_collective":"shields"}},"created_at":"2019-03-03T23:49:29.000Z","updated_at":"2024-04-18T12:27:57.000Z","dependencies_parsed_at":"2023-02-19T00:31:12.316Z","dependency_job_id":null,"html_url":"https://github.com/badges/svg-to-image-proxy","commit_stats":null,"previous_names":["paulmelnikow/svg-to-image-proxy"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badges%2Fsvg-to-image-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badges%2Fsvg-to-image-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badges%2Fsvg-to-image-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badges%2Fsvg-to-image-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badges","download_url":"https://codeload.github.com/badges/svg-to-image-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243578230,"owners_count":20313787,"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":["image","png","proxy","rasterizer","svg"],"created_at":"2024-07-30T20:00:49.254Z","updated_at":"2025-03-14T12:31:48.746Z","avatar_url":"https://github.com/badges.png","language":"JavaScript","funding_links":["https://opencollective.com/shields"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# svg-to-image-proxy\n\n## ⚠️ Deprecated\n\nThis package is now deprecated and archived. Shields.io has migrated to [squint](https://github.com/badges/squint/) for SVG to PNG conversion.\n\n---\n\n[![backers and sponsors](https://img.shields.io/opencollective/all/shields.svg?style=flat-square)][opencollective]\n[![chat](https://img.shields.io/discord/308323056592486420.svg?style=flat-square)][discord]\n[![version](https://img.shields.io/npm/v/svg-to-image-proxy.svg?style=flat-square)][npm]\n[![license](https://img.shields.io/npm/l/svg-to-image-proxy.svg?style=flat-square)][npm]\n[![build](https://img.shields.io/circleci/project/github/badges/svg-to-image-proxy.svg?style=flat-square)][build]\n[![code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)][prettier]\n\n[opencollective]: https://opencollective.com/shields\n[npm]: https://npmjs.com/svg-to-image-proxy\n[build]: https://circleci.com/gh/badges/svg-to-image-proxy/tree/master\n[prettier]: https://prettier.io/\n[discord]: https://discordapp.com/invite/HjJCwm5\n\nWeb function to generate PNGs from SVGs. Based on [convert-svg-to-png][]\nwhich uses headless Chromium.\n\nThe proxy accepts a request for e.g. `https://raster.example.com/example.png`\nand translates it to a request for\n`https://other-server.example.com/example.svg`. If the path doesn't contain\n`.png`, it passes is unchanged, e.g. `https://raster.example.com/example` to\n`https://other-server.example.com/example`.\n\nThe query string is also forwarded upstream. Cache headers are forwarded downstream.\n\nThe host comes from the `BASE_URL` environment variable.\n\nDesigned for [Shields][] though may be useful for other application as well.\n\n[shields]: https://github.com/badges/shields\n[convert-svg-to-png]: https://www.npmjs.com/package/convert-svg-to-png\n\n## Architecture\n\n- The code is is [one file][].\n- It's based on the [Micro][] framework.\n- Rasterization uses headless Chromium via [Puppeteer][], wrapped in the\n  [convert-svg-to-png][] library.\n- The service has no state. It simply fetches corresponding SVG badges from the\n  upstream service, rasterizes them, and forwards cache headers along with the\n  response.\n- Caching the rasterized badges is handled by a downstream CDN.\n\n[one file]: https://github.com/badges/svg-to-image-proxy/blob/master/rasterize.js\n[micro]: https://github.com/zeit/micro\n[puppeteer]: https://pptr.dev/\n\n## Deployment\n\nRuns on Zeit Now.\n\n## raster.shields.io production hosting\n\nStaging: https://shields-raster-staging.now.sh/\n\nProduction: https://raster.shields.io/\n\n`raster.shields.io` hosting is provided by:\n\n- [Zeit Now][zeit now]\n- [Zeit Smart CDN][cdn]\n- [Now for GitHub][]\n\nPull requests are deployed automatically. Staging is deployed automatically\nfrom master. Production is deployed manually for now.\n\nFor information about current deploys, see the [Now dashboard][]. See [production hosting][]\nfor a list of maintainers with access.\n\n`raster.shields.io` is configured in the Shields Cloudflare as a CNAME for\n`alias.zeit.co` with traffic configured not to pass through Cloudflare. That's\nbecause it's cached by [Now's Smart CDN][cdn] instead.\n\n### Production Deployment\n\nTo deploy, run `now alias shields-raster-staging.now.sh raster.shields.io`.\nThis ships the current staging build to production.\n\nTo setup your environment to run `now`, you'll need to install the CLI, login, and switch to the Shields team.\n\n```bash\nnpm i -g now\nnow login\nnow teams switch shields1\n```\n\n[zeit now]: https://zeit.co/now\n[cdn]: https://zeit.co/smart-cdn\n[now for github]: https://zeit.co/github\n[now dashboard]: https://zeit.co/shields1/svg-to-image-proxy\n[production hosting]: https://github.com/badges/shields/blob/master/doc/production-hosting.md\n\n## Support\n\nIf you're having problems with the service, you can post questions in the\n[`#support` room in Discord][discord] and [the main Shields repo][new issue].\n\n## Contributing\n\nIf you use and love Shields, we ask that you\n[make a one-time \\$10 donation to Shields][opencollective]. You can also\ncontribute monthly or sponsor at a higher level.\n\nContributions welcome! Feel free to\n[open discussions on the main Shields repo][new issue] and to open pull requests here.\n\nThe [`#contributing` room in Discord][discord] is also a good place to discuss and ask\nquestions.\n\n[new issue]: https://github.com/badges/shields/issues/new/choose\n\n## License\n\nThis project is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadges%2Fsvg-to-image-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadges%2Fsvg-to-image-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadges%2Fsvg-to-image-proxy/lists"}