Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
barcode-detector
Advanced tools
Spec compliant polyfill of the [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api). It can be used for barcode/QR-code recognition in images from various kinds of sources including `<canvas>`, ``, `` (in
Spec compliant polyfill of the Barcode Detection API.
It can be used for barcode/QR-code recognition in images from various kinds of
sources including <canvas>
, <img>
, <image>
(inside SVGs), <video>
, File
, Blob
, ImageData
, ImageBitmap
, OffscreenCanvas
.
Design goals:
npm install barcode-detector
import BarcodeDetector from "barcode-detector"
// polyfill unless already supported
if (!("BarcodeDetector" in window)) {
window.BarcodeDetector = BarcodeDetector
}
// pick barcode formats. Other formats will be ignored
const barcodeDetector = new BarcodeDetector({ formats: ["qr_code"] })
// directly pass an image element, video element, ...
const barcodes = await barcodeDetector.detect(someImageSource)
// can detect multiple barcodes in one image
const [ barcode1, barcode2, ...evenMoreBarcodes ] = barcodes
// access encoded string
const { rawValue } = barcode1
For in-depth documentation checkout the corresponding MDN page.
src/BarcodeDetectorJsqr.ts
:
aztec
code_128
code_39
code_93
codabar
data_matrix
ean_13
ean_8
itf
pdf417
qr_code
upc_a
upc_e
src/BarcodeDetectorZXing.ts
(not exposed at the moment. See #1):
aztec
code_128
code_39
code_93
codabar
data_matrix
ean_13
ean_8
itf
pdf417
qr_code
upc_a
upc_e
FAQs
A Barcode Detection API polyfill that uses ZXing webassembly under the hood
We found that barcode-detector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.