npm.io
1.0.12 • Published 6 years ago

@anzerr/svg.to.img

Licence
MIT
Version
1.0.12
Deps
4
Size
7 kB
Vulns
16
Weekly
0
Stars
1

Intro

GitHub Actions status | publish

convert svg to png or jpg using canvas

Install

npm install --save git+https://github.com/anzerr/svg.to.img.git
npm install --save @anzerr/svg.to.img
Example
const convert = require('svg.to.img'),
	fs = require('fs.promisify');

convert('./test/1.svg', {width: 100, height: 100}).then((res) => {
	return fs.writeFile('1.png', res);
});

Keywords