html-to-image-puppeteer
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

html-to-image-puppeteer

Node.js library to convert HTML to image using Puppeteer.

Table of Contents

Installation

To install the dependencies, run:

npm install


Usage
Here is an example of how to use the library:

const { convertHtmlToImage } = require('html-to-image-puppeteer');

const htmlContent = '<html><body><h1>Hello, World!</h1></body></html>';
const outputPath = 'output.png';

convertHtmlToImage(htmlContent, outputPath)
  .then(() => {
    console.log('Image created successfully!');
  })
  .catch((error) => {
    console.error('Error creating image:', error);
  });

Scripts
test: Run the tests using Jest.
lint: Lint the code using ESLint.
build: Compile the TypeScript code to JavaScript.
To run a script, use:

For example, to run the tests:

Contributing
Contributions are welcome! Please open an issue or submit a pull request.

Contributors
Subodha Sahu (subodha.sahu-graymatter@monotype.com)

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

Readme

Keywords

none

Package Sidebar

Install

npm i html-to-image-puppeteer

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

60.1 kB

Total Files

22

Last publish

Collaborators

  • subodha.sahu