Added support for type commands

This commit is contained in:
Sebastian Fischlmayr 2022-10-07 13:54:17 +02:00
parent abb422c7f1
commit 4c853ae503
Signed by: Maverick
GPG key ID: 6379E413924A4E77
3 changed files with 39 additions and 14 deletions

15
html-to-png.js Normal file
View file

@ -0,0 +1,15 @@
import { Puppeteer } from "puppeteer";
export default async function (html) {
const browser = await Puppeteer.launch();
const page = await browser.newPage();
await page.setContent(html);
const file = await page.screenshot({ type: "png" });
await page.close();
await browser.close();
return file;
}