QR Scanner: JavaScript QR code detection library
Webcam and image QR detection with native API fallback.
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.
WebWorker-based processing
The scanning algorithm runs in a separate WebWorker thread, keeping the main UI thread responsive during detection operations.
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.
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();Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
Colima
Lima-based container runtime provisioning for macOS and Linux.
plotly.py
Interactive browser-based charts from Python with declarative API.
GraphiQL
Browser-based GraphQL IDE with language service tooling.
Create T3 App
Interactive CLI for scaffolding typesafe Next.js applications with the T3 Stack technology combination.
Instaloader
Python CLI for downloading Instagram posts, stories, profiles, and metadata.
Related Reading
Guides and comparisons from the Greptile content library
Best Developer Productivity Tools in 2026
The best developer productivity tools in 2026, compared by the workflow problem they solve: code review, autocomplete, AI-native editing, terminal agents, code search, observability, and security.
How to ACTUALLY Think About Code Reviews: The 3-Layer Checklist
A code review checklist and best practices organized around three layers — Mechanical, Structural, and Narrative — that help any team improve code quality without slowing reviews down.
Best CodeRabbit Alternatives for Smarter AI Code Reviews in 2026
7 powerful CodeRabbit alternatives ranked by real dev teams. Feature comparison, pricing analysis, and honest reviews to find your perfect AI code reviewer.
Choosing the Right Code Review Tool: Better Alternatives to Graphite AI
A breakdown of the best alternatives to Graphite for code reviews. Compare AI tools like Trag, open-source solutions like Gerrit, and database-focused platforms like Visual Expert.