html2svg
A module which can convert HTML document to svg file.
Last updated 2 years ago by mrpeak .
ISC · Repository · Bugs · Original npm · Tarball
$ cnpm install html2svg 
SYNC missed versions from official npm registry.

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

Param Description required default tip
input Input path. true null File URIs or HTTP URIs
output Ouput path with file name. true null -
needJSRender Tell it whether process JS Rendering or not. false null -

Support

Please open an issue for support.

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |