
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
barcode-detection
Advanced tools
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
Via CDN:
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js"></script>
<script type="text/javascript" src="https://unpkg.com/@zxing/browser@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/barcode-detection@latest/dist/barcode-detector.umd.js"></script>
Via npm:
npm install barcode-detection
Then import the package:
import {default as BarcodeDetectorPolyfill} from "barcode-detection"
let barcodeDetector;
async function init() {
if ("BarcodeDetector" in window) {
alert('Barcode Detector supported!');
}else{
alert('Barcode Detector is not supported by this browser, using the Dynamsoft Barcode Reader polyfill.');
BarcodeDetectorPolyfill.engine = "DBR"; // options: DBR and ZXing.
//initialize the Dynamsoft Barcode Reader with a license
BarcodeDetectorPolyfill.setDBRLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==");
await BarcodeDetectorPolyfill.initDBR();
window.BarcodeDetector = BarcodeDetectorPolyfill;
}
barcodeDetector = new window.BarcodeDetector({ formats: ["qr_code"] });
}
async function decode(imgEl) {
//decode an image element
let barcodes = await barcodeDetector.detect(imgEl);
}
You can apply for a license of Dynamsoft Barcode Reader here.
Dynamsoft Barcode Reader:
ZXing:
FAQs
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
The npm package barcode-detection receives a total of 68 weekly downloads. As such, barcode-detection popularity was classified as not popular.
We found that barcode-detection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.