A React barcode scanner component with WASM support for ZXing and Photon image processing. Includes IIFE standalone build for direct browser use.
npm install fast-barcode-scannerA professional barcode scanner application powered by WebAssembly with advanced image processing and multi-engine detection.
- Multi-Engine Detection: Native BarcodeDetector API + ZXing WASM
- Advanced Image Processing: Photon WASM for enhancement (grayscale, contrast, sharpen, threshold, histogram equalization)
- Intelligent Frame Caching: SubtleCrypto SHA-256 hashing with JS fallback
- Adaptive Rotation: Automatic 90°/270° rotation with Photon WASM or Canvas fallback
- Configurable FPS: Default 30 FPS, fully configurable
- Parallel Processing: All enhancement techniques run simultaneously
- Multiple Formats: EAN-13, EAN-8, UPC-A, UPC-E, Code128, Code39, QR, DataMatrix, and more
- š¦ NPM Package Ready: Full build and export configuration included
This project includes complete packaging configuration to publish as a reusable npm package with Bun as the bundler!
- Bun - Fast JavaScript runtime and bundler (Install Bun)
``bash`
curl -fsSL https://bun.sh/install | bash
`bashInstall dependencies (if not already installed)
bun install
$3
The build process using Bun:
1. Bundles all React components and hooks into optimized IIFE format
2. Generates TypeScript declarations for full type safety
3. Copies WASM files from dependencies (ZXing, Photon) to dist
4. Exposes global
window.FastBarcodeScanner for direct browser use
5. No module system required - works with simple