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

@lesjoursfr/html-to-image

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lesjoursfr/html-to-image

A library to generate images from HTML.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by14.29%
Maintainers
1
Weekly downloads
 
Created
Source

npm version QC Checks

@lesjoursfr/html-to-image

Generate PNG/JPEG images from HTML with simple API in Node.js.

What is this library?

This library use electron to generate PNG/JPEG images from HTML.

Usage

Install the lib and add it as a dependency :

    npm install @lesjoursfr/html-to-image

Then put this in your code:

const { HtmlToImage } = require("@lesjoursfr/html-to-image");

const htmlToImage = new HtmlToImage(target, output, selector, outputType);
htmlToImage
	.render()
	.then(() => {
		console.log("Image Generated Successfully!");
	})
	.catch((err) => {
		console.error("Failed to generate Image because of ", err);
	});
Parameters
  • target: The URL of the HTML page
  • output: The image file path
  • selector: The CSS selector of the content to capture
  • outputType: The image type ("png" or "jpeg", default to "jpeg")

Keywords

FAQs

Package last updated on 11 Apr 2024

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