Converts SVGs to PNGs
npm install svg-to-png
Converts SVGs to PNGs
npm install svg-to-png``javascript
var svg_to_png = require('svg-to-png');
svg_to_png.convert("input", "output") // async, returns promise
.then( function(){
// Do tons of stuff
});
`
$3
#### Input
Type:
String or ArrayThe Input can be one of: A
String that is the file being converted, a
String that is a directory of files to be converted, or an Array of
files to convert.Note: The files passed in MUST ALL be SVGs. If you want to pass in a
directory that is not all SVGs, use
fs.readdir, filter the results,
and pass those in. An error will be thrown otherwise.#### Output
Type:
StringOutput folder
$3
#### Options
Type:
Object*
defaultWidth: normally 400px
* defaultHeight: normally 300px
* compress: Default false, if true, will compress your png file
using optipng
* optimizationLevel: Default 3, if compress is set to true, this will set the optimationLevel for optipng
* debug`: enables console log outputThis repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.
The enhancement backlog can be found here: https://github.com/filamentgroup/svg-to-png/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+
Don’t forget to upvote the top comment of each issue with 👍!