7 lines
249 B
TypeScript
7 lines
249 B
TypeScript
import QRCode from "qrcode";
|
|
|
|
export async function renderQrPng(payload: string): Promise<Buffer> {
|
|
if (!payload) throw new Error("renderQrPng: payload is empty");
|
|
return await QRCode.toBuffer(payload, { type: "png", width: 512, margin: 2 });
|
|
}
|