This module exposes a function that generates images (png, jpeg) from HTML. It uses a puppeteer in headless mode to achieve it. Additionally, it embarks Handlebars to provide a way to add logic to your HTML. When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. node-html-to-image takes a screenshot of the body tag's content. If you want to set output image's resolution you need to set its dimension using CSS. Handlerbars is a templating language. It generates HTML from a template and an input object. In the following example we provide a template to node-html-to-image and a content object to fill the template.

Features

  • Simple examples
  • TypeScript Support
  • Set output image resolution
  • Use Handlebars helpers
  • Use the buffer instead of saving to disk
  • Generate multiple images

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Welcome to node-html-to-image

Welcome to node-html-to-image Web Site

Other Useful Business Software
Build AI Apps with Gemini 3 on Vertex AI Icon
Build AI Apps with Gemini 3 on Vertex AI

Access Google’s most capable multimodal models. Train, test, and deploy AI with 200+ foundation models on one platform.

Vertex AI gives developers access to Gemini 3—Google’s most advanced reasoning and coding model—plus 200+ foundation models including Claude, Llama, and Gemma. Build generative AI apps with Vertex AI Studio, customize with fine-tuning, and deploy to production with enterprise-grade MLOps. New customers get $300 in free credits.
Try Vertex AI Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Welcome to node-html-to-image!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript HTML XHTML, TypeScript Multimedia Software

Registered

2023-05-04