1.0.1 • Published 8 years ago

html2svg v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Build Status

html2svg convertor

A converter which could convert HTML document to SVG image.

Even if a JS-Rendered HTML!

Installation

Available on NPM as fetch.

$ npm install html2svg

Usage

Implement Promise (es6)

const html2svg = require('html2svg');
const input = 'file:///root/path/file.ext'; // Or: http://google.com
const output = '/root/path/file.ext';
const needJSRender = true;

html2svg({input, output, needJSRender}).then(res => {
    console.log(res);
}).catch(err => {
    console.error(err);
});

Work with async-await (es7)

const html2svg = require('html2svg');
const input = 'file:///root/path/file.ext'; // Or: http://google.com
const output = '/root/path/file.ext';

(async function() {

  try {
    let res = await html2svg({input, output});

    console.log(res);
  } catch(err) {
    console.error(err)
  }

}());

Config

ParamDescriptionrequireddefaulttip
inputInput path.truenullFile URIs or HTTP URIs
outputOuput path with file name.truenull-
needJSRenderTell it whether process JS Rendering or not.falsenull-

Support

Please open an issue for support.

1.0.1

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago