{"id":21947664,"url":"https://github.com/valpackett/broccoli-rsvg","last_synced_at":"2026-05-18T04:37:09.526Z","repository":{"id":15534781,"uuid":"18269448","full_name":"valpackett/broccoli-rsvg","owner":"valpackett","description":"A Broccoli plugin for rendering SVG files to PNG.","archived":false,"fork":false,"pushed_at":"2016-04-11T17:10:21.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T09:05:39.012Z","etag":null,"topics":["broccoli","broccoli-plugin","rsvg","svg"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valpackett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-30T17:35:33.000Z","updated_at":"2023-09-08T16:46:38.000Z","dependencies_parsed_at":"2022-09-18T22:23:22.392Z","dependency_job_id":null,"html_url":"https://github.com/valpackett/broccoli-rsvg","commit_stats":null,"previous_names":["myfreeweb/broccoli-rsvg"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fbroccoli-rsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fbroccoli-rsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fbroccoli-rsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fbroccoli-rsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valpackett","download_url":"https://codeload.github.com/valpackett/broccoli-rsvg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244583143,"owners_count":20476233,"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":["broccoli","broccoli-plugin","rsvg","svg"],"created_at":"2024-11-29T05:09:07.658Z","updated_at":"2025-09-23T04:17:26.952Z","avatar_url":"https://github.com/valpackett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# broccoli-rsvg [![npm version](https://img.shields.io/npm/v/broccoli-rsvg.svg?style=flat)](https://www.npmjs.org/package/broccoli-rsvg) [![npm downloads](https://img.shields.io/npm/dm/broccoli-rsvg.svg?style=flat)](https://www.npmjs.org/package/broccoli-rsvg) [![Build Status](https://img.shields.io/travis/myfreeweb/broccoli-rsvg.svg?style=flat)](https://travis-ci.org/myfreeweb/broccoli-rsvg) [![Dependency Status](https://img.shields.io/gemnasium/myfreeweb/broccoli-rsvg.svg)](https://gemnasium.com/myfreeweb/broccoli-rsvg) [![unlicense](https://img.shields.io/badge/un-license-green.svg?style=flat)](http://unlicense.org) \n\nThis [Broccoli] plugin renders SVG files to PNG using [node-rsvg].\n\n[Broccoli]: https://github.com/joliss/broccoli\n[node-rsvg]: https://github.com/2gis/node-rsvg\n\n## Installation\n\nFirst, get librsvg:\n\n- OS X: `brew install librsvg`\n- FreeBSD: `pkg install graphics/librsvg2`\n- Ubuntu/Debian: `sudo apt-get install librsvg2-dev`\n- Fedora/CentOS/OpenSUSE: `sudo yum install librsvg2-devel`\n\nSecond, install as any other broccoli plugin:\n\n```bash\nnpm install --save-dev broccoli-rsvg\n```\n\n## Usage\n\n```js\nvar renderSvg = require('broccoli-rsvg')\n\nvar outputTree = renderSvg(inputNodes, fileOptions)\n```\n\n- **`inputNodes`**: A list of nodes (trees) that contain the SVG files you want to render.\n- **`fileOptions`**: A hash of rsvg options and alternative versions for each file; see the following example.\n\n## Example\n\n```js\nvar Rsvg = require('broccoli-rsvg')\n\nvar png = new Rsvg(['svg'], {\n  'logo.svg': {\n    width: 600,\n    height: 500, // optional override, values from the svg file itself are used by default\n    versions: [\n      { // Retina version example\n        path: 'logo@2x.png',\n        width: 1200,\n        height: 1000\n      },\n      { // Transformed version example\n        transformer: function(svg) {\n          return svg.replace('#000000', '#ffffff') // You can use elementtree or xmldom here...\n        },\n        path: 'logo-black.png',\n        versions: [\n          { // Nested example: transformed + retina\n            path: 'logo-black@2x.png',\n            width: 1200,\n            height: 1000\n          }\n        ]\n      }\n    ]\n  }\n})\n\nreturn [svg, png]\n```\n\n**Note**: avoid passing [broccoli-svgo] output to rsvg, it might get screwed up.\n\n[broccoli-svgo]: https://github.com/sindresorhus/broccoli-svgo\n\n## Contributing\n\nPlease feel free to submit pull requests!\n\nBy participating in this project you agree to follow the [Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/).\n\n## License\n\nThis is free and unencumbered software released into the public domain.  \nFor more information, please refer to the `UNLICENSE` file or [unlicense.org](http://unlicense.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalpackett%2Fbroccoli-rsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalpackett%2Fbroccoli-rsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalpackett%2Fbroccoli-rsvg/lists"}