4.1.0 • Published 4 years ago

svgpng v4.1.0

Weekly downloads
22
License
MIT
Repository
github
Last release
4 years ago

svgpng

Build Status npm Version

Convert SVG image into PNG.

Installation

Installing svgpng via npm

npm install svgpng --save

Usage

Converting a Single SVG File into PNG

#!/usr/bin/env/node

const svgpng = require('svgpng')

;(async () => {
  await svgpng(
    'src/foo.svg',
    'dest/foo.png',
    {
      size: {
        width: 400,
        height: 300
      }
    }
  )
})()

Converting Multiple SVG Files into PNG

#!/usr/bin/env/node

const svgpng = require('svgpng')

;(async () => {
  await svgpng.byConf([
    {
      src: 'src/foo.svg',
      dest: 'dest/foo.png',
      size: {
        width: 400,
        height: 300
      }
    },
    {
      src: 'src/bar.svg',
      dest: 'dest/bar.png',
      size: {
        width: 100,
        height: 200
      }
    }
  ])
})()

CLI

$ npm install svgpng -g
$ svgpng src/foo.svg dest/foo.png -w 256 -h 360

License

This software is released under the MIT License.

Links

4.1.0

4 years ago

4.0.1

5 years ago

4.0.0

6 years ago

3.0.0

7 years ago

2.0.0

8 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago