Navigate:
All Reposqr-scanner
~$QRSCAN0.0%

QR Scanner: JavaScript QR code detection library

Webcam and image QR detection with native API fallback.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#266
DEVELOPER TOOLS
#56
30 DAY RANKING TREND
ovr#266
·Devel#56
STARS
2.8K
FORKS
568
DOWNLOADS
110.1K
7D STARS
0
7D FORKS
-1
See Repo:
Share:

Learn more about qr-scanner

QR Scanner is a JavaScript library that detects and decodes QR codes in web browsers. It processes video streams from webcams or analyzes single images, running the detection algorithm in a WebWorker to avoid blocking the main thread. The library automatically uses the browser's native BarcodeDetector API if supported, otherwise falls back to a JavaScript-based decoder. It supports both continuous video scanning and single-image analysis, with configuration options for optimizing detection on colored QR codes.

qr-scanner

1

WebWorker-based processing

The scanning algorithm runs in a separate WebWorker thread, keeping the main UI thread responsive during detection operations.

2

Native API fallback pattern

Automatically uses the browser's native BarcodeDetector API when available, reducing the loaded code size to approximately 5.6 kB gzipped. Falls back to the JavaScript implementation for unsupported browsers.

3

Dual-file architecture

Consists of a main module and a separate worker script that loads dynamically only when needed, allowing for flexible deployment and bundling strategies.


import QrScanner from 'qr-scanner';

const videoElem = document.getElementById('video');
const qrScanner = new QrScanner(
  videoElem,
  result => console.log('Decoded QR:', result.data),
  { highlightScanRegion: true }
);

qrScanner.start();


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers