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 = ;const input = 'file:///root/path/file.ext'; // Or: http://google.comconst output = '/root/path/file.ext';const needJSRender = true; ;
Work with async-await (es7)
const html2svg = ;const input = 'file:///root/path/file.ext'; // Or: http://google.comconst output = '/root/path/file.ext'; { try let res = await ; console; catcherr console };
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.