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

html-as

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-as

A Node.js module providing functions for asynchronous HTML conversion and image download. Simplify tasks such as converting HTML content to images and initiating downloads with ease.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

html-as

npm version

html-as is a simple npm module that provides a function for asynchronously converting the content of an HTML element to an image and initiating the download. It uses the popular html2canvas library under the hood.

Installation

npm install html-as

Usage

import { downloadHtmlAsImage } from 'html-as';

// Defining an asynchronous function to download an HTML element as an image.

const downloadHtmlElementAsImage = async () => {
	const element = document.body;

	await downloadHtmlAsImage(element, 'body_image', 'jpeg', 2);
}

Error Handling

Any errors that occur during the process are logged to the console.

Dependencies

html2canvas

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

Package last updated on 12 Dec 2023

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