-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
In order to deal with the QR Code image file convenience, we start supporting the following two new methods in the FileBox v0.10:
FileBox.fromQRCode(qrCodeValue: string)
Get a FileBox instance that represent a QR Code value.
const fileBox = FileBox.fromQRCode('https://github.com')
fileBox.toFile('qrcode.png')
fileBox.toQRCode(): Promise<string>
Decode the QR Code value from the file.
const fileBox = FileBox.fromFile('qrcode.jpg')
const qrCodeValue = await fileBox.toQRCode()
console.log(`QR Code decoded value is: "${qrCodeValue}"`)
// Output: QR Code decoded value is: "https://github.com"
I hope you will enjoy it!