{"_id":"react-svg-to-image","_rev":"1-6cee421068537ef1114a11c681c57363","name":"react-svg-to-image","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"react-svg-to-image","version":"3.0.0","description":"Converts SVG elements into images (PNG, JPG and etc)","main":"index.js","scripts":{"start":"parcel index.html","build":"parcel build index.html --out-file react-svg-to-image.min.js"},"types":"typing.d.ts","keywords":["react-svg-to-image","svg to image","svg","png","jpg","jpeg","webp","d3","data","visualization","js","javascript","css","dom","html"],"author":{"name":"Taslim A Hussain"},"repository":{"type":"git","url":"git+https://github.com/taslim-a-hussain/react-svg-to-image.git"},"bugs":{"url":"https://github.com/taslim-a-hussain/react-svg-to-image/issues"},"homepage":"https://github.com/taslim-a-hussain/react-svg-to-image#readme","license":"MIT","devDependencies":{"parcel-bundler":"^1.12.4"},"browserslist":["last 32 Chrome versions","last 20 firefox version","last 8 safari version"],"gitHead":"9badb540b84f03569cc5a4a6a443b54c3d11cd92","_id":"react-svg-to-image@3.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-6qV45Sx+2H4GSXlkoMc4msOhwXCLvTgkei8TybzIthBAVVvUrL4E2VuY1T9rduInnXajqkY+X5XKGHYteUlLZQ==","shasum":"90829a2efd0634b3aeb2a21581a4883fe66f7617","tarball":"https://registry.npmjs.org/react-svg-to-image/-/react-svg-to-image-3.0.0.tgz","fileCount":5,"unpackedSize":6848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0ZoQCRA9TVsSAnZWagAAIVsP/i6Og1ZjlSsBXVoiw8eg\n8e8d+E06UwHSkvIW5YWHiDvam4Or3Z08nhjhER0CvQ4CpljPqyArx5WDAD2G\n8GujGCwA4gEGqfr29HSLMSyqoO4jvQ77ZzWDhqcAt18UmwgJ2JohLu0/ijIi\nlXDNML3LYwZqyqjkX6GLOpejWvZM43XSDLPJV+BBhsCir0lmOtVtcI1k+87y\n0RLcL5bP0WIyPNLpxrT2e1WIMNtk584dVp0EdQ+5vgjWznRZWui+n76B3ScY\njGXYZgIG9roG5dlsF/tN2ygHxykdKlsmUzuL2X9O+tAM27bQ9gceZmG4dXta\nOBsHfe2299R+oqSKLAuvFtPlOObioXMXKoFqtm1t+dFNYSwDEMTjbSHX93qP\nMQytNZk5X+CWjSSXYVQ7/8GnuySwoVYWKKQFrdSLCeLqBI98QVVXcYoOaiTb\no4lmLGk1D6cMYSR47r3c0VZtdiAgi2WcyqOhP9RRbtWWGnErZPjlavPEKuTT\nhNXUwni6yV+XMVAmbJYVtENXM7e1xvhaqqGNiDItK76N2Uio5L4e1yu98xVo\nmbMntTkXswfSeQGLUKs22Wof3DIzIdADdR/Cqe5GCbg67kuBrVeElpy4oGGU\nLY6j6xhOGDQG0lma2ILkpM8nWvGmEVwBqOM5U91aEjZwieMSURieulEb1LuG\nX0fW\r\n=ZbOa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNpW4fgxQczq/hJCD9biDXwhL64AI2hgEWdj6VWZ0nmAiEAynqRUU0Pn66ImGxpkvB1cvp4EHUVZ8EdgHodJPZVE4Q="}]},"maintainers":[{"name":"taslim-a-hussain","email":"taslim@outlook.co.nz"}],"_npmUser":{"name":"taslim-a-hussain","email":"taslim@outlook.co.nz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-svg-to-image_3.0.0_1590794768390_0.4635243086919889"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-29T23:26:08.390Z","3.0.0":"2020-05-29T23:26:08.500Z","modified":"2022-05-15T05:28:21.406Z"},"maintainers":[{"name":"taslim-a-hussain","email":"taslim@outlook.co.nz"}],"description":"Converts SVG elements into images (PNG, JPG and etc)","homepage":"https://github.com/taslim-a-hussain/react-svg-to-image#readme","keywords":["react-svg-to-image","svg to image","svg","png","jpg","jpeg","webp","d3","data","visualization","js","javascript","css","dom","html"],"repository":{"type":"git","url":"git+https://github.com/taslim-a-hussain/react-svg-to-image.git"},"author":{"name":"Taslim A Hussain"},"bugs":{"url":"https://github.com/taslim-a-hussain/react-svg-to-image/issues"},"license":"MIT","readme":"# react-svg-to-image\n\nreact-svg-to-image was forked from JuanIrache/d3-svg-to-png.\nConverts SVG elements in the browser to PNG and other image formats, while keeping CSS styles. Optionally, it returns the data as a promise or downloads it. It can also rescale the svg image, ignore certain DOM elements...\n\n## Installation\n\n```shell\n$ npm i react-svg-to-image\n```\n\n## Usage\n\n```js\nconst toImg = require('react-svg-to-image');\ntoImg('selector', 'name');\n\nor\n\nimport toImg from 'react-svg-to-image';\n```\n\n## Mandatory fields\n\n- **Selector** (String): Commonly 'svg'.\n- **Name** (String): Name for the file output, without extension.\n\nOutput: **name.png**\n\n## Options\n\n```js\nconst toImg = require('react-svg-to-image');\n\nor \n\nimport toImg from 'react-svg-to-image';\n\ntoImg('svg', 'name', {\n  scale: 3,\n  format: 'webp',\n  quality: 0.01,\n  download: false,\n  ignore: '.ignored'\n}).then(fileData => {\n  //do something with the data\n});\n```\n\n- **scale** (number): Rescale the image by this factor. Default: _1_\n- **format** (string): The format to output to. Compatibility might vary between browsers. See [HTMLCanvasElement.toDataURL()\n  ](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL). Default: _png_\n- **quality** (number): Between 0 (lowest) and 1. Affects formats with compression, like jpg. Default: _.92_\n- **download** (boolean): Wether to download the resulting image. Default: _true_\n- **ignore** (string): A CSS selector, the matched elements of which will not be added to the output. Default: _null_\n\n\n## Contribution\n\nPlease make your changes to the **dev** branch, so that automated tests can be run before merging to **master**. Also, if possible, provide tests for new functionality.","readmeFilename":"readme.md"}