Package Exports
- dynamsoft-javascript-barcode
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dynamsoft-javascript-barcode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Dynamsoft JavaScript Barcode SDK for Node and Web

A WebAssembly barcode library for building JavaScript barcode detection apps.
Overview
Dynamsoft JavaScript Barcode Reader is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR Code, DataMatrix, PDF417, and Aztec Code.
Supported Barcode Symbologies
- 1D barcode: Code 39, Code 93, Code 128, Codabar, EAN-8, EAN-13, UPC-A, UPC-E, Interleaved 2 of 5 (ITF), Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5), ITF-14.
- 2D barcode: QRCode, DataMatrix, PDF417, and Aztec Code.
Browser Compatibility
| Browser | Version |
|---|---|
| Chrome | v57+ |
| Firefox | v52+ |
| Edge | v16+ |
| Safari* | v11+ |
| Internet Explorer | not supported |
Usage
Node
var BarcodeReader = require('dynamsoft-javascript-barcode');
BarcodeReader.licenseKey = 'LICENSE-KEY';
var reader;
BarcodeReader.createInstance().then(r =>
(reader = r) && r.decode('sample.png')
).then(results => {
for(var i = 0; i < results.length; ++i){
console.log(results[i].BarcodeText);
}
reader.deleteInstance();
});Web
<!DOCTYPE html>
<html>
<body>
<script src="node_modules/dynamsoft-javascript-barcode/dist/dbr.min.js"></script>
<script>
BarcodeReader.licenseKey = 'LICENSE-KEY';
let videoReader = new BarcodeReader.VideoReader({
onFrameRead: results => {console.log(results);},
onDiffCodeRead: (txt, result) => {alert(txt);}
});
videoReader.read();
</script>
</body>
</html>Alternatively, you can use the jsDelivr CDN as follows:
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode"></script>Use Web Server for Chrome for quick deployment.
API Reference
https://github.com/dynamsoft-dbr/javascript-barcode/blob/master/documents/api-original.md
Samples
- samples/node
- samples/web
More: https://github.com/dynamsoft-dbr/javascript-barcode
Online Demo
https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html

License
Get a FREE 30-day trial license.