Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html2svg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html2svg

A module which can convert HTML document to svg file.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by30%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 31 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc