{"id":15608517,"url":"https://github.com/hypercubed/svgsaver","last_synced_at":"2025-08-17T14:35:21.394Z","repository":{"id":57305883,"uuid":"42714528","full_name":"Hypercubed/svgsaver","owner":"Hypercubed","description":" download an svg element as an SVG or PNG file, including CSS defined styles","archived":false,"fork":false,"pushed_at":"2017-05-08T17:37:52.000Z","size":270,"stargazers_count":58,"open_issues_count":4,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T13:46:47.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hypercubed.github.io/svgsaver/demo/","language":"JavaScript","has_issues":true,"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/Hypercubed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-18T10:12:38.000Z","updated_at":"2025-01-25T00:44:53.000Z","dependencies_parsed_at":"2022-08-31T04:52:56.369Z","dependency_job_id":null,"html_url":"https://github.com/Hypercubed/svgsaver","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fsvgsaver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fsvgsaver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fsvgsaver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fsvgsaver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hypercubed","download_url":"https://codeload.github.com/Hypercubed/svgsaver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860005,"owners_count":21173343,"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-10-03T05:21:14.630Z","updated_at":"2025-04-14T10:21:04.469Z","avatar_url":"https://github.com/Hypercubed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svgsaver\r\n\r\nDownload an SVG element as an SVG or PNG file, including CSS defined styles.\r\n\r\n[![NPM version][npm-badge]][npm]\r\n[![Downloads][download-badge]][npm]\r\n![Downloads][bower-badge]\r\n\r\n[![Build Status][travis-image]][travis-url]\r\n[![Codacy Badge][codacy-badge]][Codacy]\r\n\r\n[![js-semistandard-style][standard-badge]][semistandard]\r\n[![License][license-badge]][MIT License]\r\n\r\n## Features\r\n- Download `\u003csvg\u003e` by element object.\r\n- Download as SVG or PNG file.\r\n- Copies SVG element styles as rendered in the browser, including styles defined in CSS style sheets.\r\n- Copies only SVG relevant and non-default styles.  [See here](http://www.w3.org/TR/SVG/propidx.html).\r\n- Computed styles are in-lined for maximum compatibility.\r\n\r\n## Install\r\n\r\n### Node\r\n\r\n```js\r\nnpm install svgsaver\r\n```\r\n\r\n### Bower\r\n\r\n```js\r\nbower install svgsaver\r\n```\r\n\r\n### JSPM\r\n\r\n```js\r\njspm install svgsaver=npm:svgsaver\r\n```\r\n\r\n## Usage\r\n\r\n*For maximum compatibility across browsers include [eligrey/FileSaver.js/](https://github.com/eligrey/FileSaver.js) and [eligrey/canvas-toBlob.js](https://github.com/eligrey/canvas-toBlob.js). See [Compatibility-Chart](https://github.com/Hypercubed/svgsaver/wiki/Compatibility-Chart) for more information.*\r\n\r\n### Example\r\n\r\n```\r\nvar SvgSaver = require('svgsaver');                 // if using CommonJS environment\r\nvar svgsaver = new SvgSaver();                      // creates a new instance\r\nvar svg = document.querySelector('#mysvg');         // find the SVG element\r\nsvgsaver.asSvg(svg);                                // save as SVG\r\n```\r\n\r\n### Demos\r\n\r\n- [Epicyclic Gearing](http://bl.ocks.org/Hypercubed/db9e99d761f90d87cf43) - d3\r\n- [Superformula Explorer](http://bl.ocks.org/Hypercubed/58fff7215e53d6565f32) - d3\r\n- [City Construction Site](http://codepen.io/Hypercubed/pen/OyWadQ) - jQuery and TweenMax\r\n- [Chiasm Boilerplate (with download buttons)](http://bl.ocks.org/Hypercubed/b01a767b41b0e679aade) - Chiasm\r\n\r\n## Acknowledgments\r\nBased on previous work on [Hypercubed/angular-downloadsvg-directive](https://github.com/Hypercubed/angular-downloadsvg-directive).  Some portions of this code inspired by [raw](https://github.com/densitydesign/raw/blob/master/js/directives.js) and [moagrius/copycss](https://github.com/moagrius/copycss).\r\n\r\n## License\r\n[MIT License]\r\n\r\n[npm]: https://npmjs.org/package/svgsaver\r\n[bower]: https://npmjs.org/package/svgsaver\r\n[semistandard]: https://github.com/Flet/semistandard\r\n[Codacy]: https://www.codacy.com/app/hypercubed/svgsaver\r\n[MIT License]: http://en.wikipedia.org/wiki/MIT_License\r\n[travis-url]: https://travis-ci.org/Hypercubed/svgsaver\r\n\r\n[travis-image]: https://img.shields.io/travis/Hypercubed/svgsaver.svg\r\n[npm-badge]: https://img.shields.io/npm/v/svgsaver.svg\r\n[bower-badge]: https://img.shields.io/bower/v/svgsaver.svg\r\n[standard-badge]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg\r\n[download-badge]: http://img.shields.io/npm/dm/svgsaver.svg\r\n[codacy-badge]: https://api.codacy.com/project/badge/6fe47dae30b34d2da78572b3ea36cfe0\r\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fsvgsaver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypercubed%2Fsvgsaver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fsvgsaver/lists"}