A tool to generate Open Graph (OG) images for ebacala.com using Puppeteer. Can be used as a command-line tool or imported as a library.
- Generate 1200x630px social media preview images
- Custom tag/category, article title, author name, and profile picture
- Beautiful gradient background design
- Use as CLI tool or import as Node.js module
- Supports multiple image formats (PNG, JPG/JPEG, GIF, BMP, WebP, SVG)
# Install dependencies
pnpm install
# Build the project
pnpm run buildimport { generateOGImage } from './generateOgImage.js';
const screenshot = await generateOGImage({
tag: "Blog",
title: "Your Article Title",
author: "Author Name",
picturePath: "path/to/picture.png"
});
// Save or process the screenshot buffer
fs.writeFileSync("og-image.png", screenshot);# Run the script directly
node script.js
# Or use the built version
node dist/index.jsRequired Parameters:
tag- Tag/category for the imagetitle- Title text for the imageauthor- Author name for the imagepicturePath- Path to profile picture
Use dev/index.html to preview the template in a browser.
# Start development server
pnpm startGenerated image saved as og-image.png in the specified output directory.
Profile pictures: PNG, JPG/JPEG, GIF, BMP, WebP, SVG