1.0.2 • Published 5 months ago

html-as v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

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.

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago