Shape dection API - Reading QR codes

const barcodeDetector = new BarcodeDetector({
  formats: [ 'qr_code']
});

try {
  const barcodes = await barcodeDetector.detect(image);
  barcodes.forEach(barcode => console.log(barcode));
} catch (e) {
  console.error('Barcode detection failed:', e);
}

Explainer here.

STATUS: early draft