Skip to content

Commit

Permalink
Create qr.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Oct 22, 2022
1 parent 828619d commit b72d1d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/server/links/qr.ts
@@ -0,0 +1,10 @@
import QRCode from 'qrcode';

export function genQRCodeSvg(url: string): Promise<string> {
return new Promise((resolve, reject) => {
QRCode.toString(url, { type: 'svg' }, (err, svg: string | PromiseLike<string>) => {
if (err) reject(err);
resolve(svg);
});
});
}

0 comments on commit b72d1d9

Please sign in to comment.