### Install node-html-to-image Source: https://github.com/frinyvonnick/node-html-to-image/blob/master/README.md Instructions for installing the node-html-to-image library using either npm or yarn package managers. ```sh npm install node-html-to-image ``` ```sh yarn add node-html-to-image ``` -------------------------------- ### Generate Image from HTML (JavaScript) Source: https://github.com/frinyvonnick/node-html-to-image/blob/master/README.md A simple example demonstrating how to use node-html-to-image in JavaScript to generate a PNG image from a basic HTML string and save it to a file. ```js const nodeHtmlToImage = require('node-html-to-image') nodeHtmlToImage({ output: './image.png', html: 'Hello world!' }) .then(() => console.log('The image was created successfully!')) ``` -------------------------------- ### Running Tests for node-html-to-image (Shell) Source: https://github.com/frinyvonnick/node-html-to-image/blob/master/README.md Provides the command line instruction to execute the test suite for the node-html-to-image project using Yarn. ```shell yarn test ``` -------------------------------- ### Import node-html-to-image (TypeScript) Source: https://github.com/frinyvonnick/node-html-to-image/blob/master/README.md Shows the standard import statement for incorporating the node-html-to-image library into a TypeScript project. ```ts import nodeHtmlToImage from 'node-html-to-image' ``` -------------------------------- ### Using Custom Puppeteer Library with node-html-to-image (JavaScript) Source: https://github.com/frinyvonnick/node-html-to-image/blob/master/README.md Demonstrates how to configure node-html-to-image to use a specific Puppeteer library (like puppeteer-core) and provide custom arguments, useful for environments such as AWS Lambda where a different Chromium executable might be required. ```javascript const chrome = require('chrome-aws-lambda'); const nodeHtmlToImage = require('node-html-to-image') const puppeteerCore = require('puppeteer-core'); const image = await nodeHtmlToImage({ html: '
Hello
', puppeteer: puppeteerCore, puppeteerArgs: { args: chromium.args, executablePath: await chrome.executablePath, } }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.