UNPKG

@akamfoad/qrcode

Version:

The library is generating QR codes as SVG, HTML5 Canvas, PNG and JPG files, or text.

9 lines (8 loc) 246 B
export const loadImage = (url: string): Promise<HTMLImageElement> => { return new Promise((resolve, reject) => { const img = new Image(); img.onload = () => resolve(img); img.onerror = () => reject(img); img.src = url; }); };