Back to rankings

zxing-js/library

TypeScriptzxing-js.github.io/library/

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.

zxingtypescriptqrcodebarcodedecoding-imagesencoding-libraryhacktoberfest
Star Growth
Stars
2.9k
Forks
578
Weekly Growth
Issues
167
1k2k
Jan 2018Nov 2020Sep 2023Jul 2026
Artifactsnpmnpm install library
README

ZXing

Looking for an actively maintained barcode scanning library with commercial support? Check out STRICH – Barcode Scanning for Web Apps.

Project in Maintenance Mode Only

[!WARNING] The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enhancements will be considered. There is otherwise no active development or roadmap for this project. It is "DIY".

Attention

NOTE: While we do not have the time to actively maintain zxing-js anymore, we are open to new maintainers taking the lead.

What is ZXing?

ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

Supported Formats

See Projects and Milestones for what is currently done and what's planned next. 👀

1D product 1D industrial 2D
UPC-A Code 39 QR Code
UPC-E Code 93 Data Matrix
EAN-8 Code 128 Aztec
EAN-13 Codabar PDF 417
ITF MaxiCode (needs testing!)
RSS-14
RSS-Expanded (not production ready!)
Micro-QR (needs testing!)

Status

Maintainer wanted Greenkeeper badge

NPM version npm Contributors Commits to deploy

Maintainability Test Coverage

Demo

See Live Preview in browser.

Note: All the examples are using ES6, be sure is supported in your browser or modify as needed, Chrome recommended.

Installation

npm i @zxing/library --save

or

yarn add @zxing/library

Limitations

On iOS-Devices with iOS < 14.3 camera access works only in native Safari and not in other Browsers (Chrome,...) or Apps that use an UIWebView or WKWebView. This is not a restriction of this library but of the limited WebRTC support by Apple. The behavior might change in iOS 11.3 (Apr 2018?, not tested) as stated here

iOS 14.3 (released in december 2020) now supports WebRTC in 3rd party browsers as well 🎉

Browser Support

The browser layer is using the MediaDevices web API which is not supported by older browsers.

You can use external polyfills like WebRTC adapter to increase browser compatibility.

Also, note that the library is using the TypedArray (Int32Array, Uint8ClampedArray, etc.) which are not available in older browsers (e.g. Android 4 default browser).

You can use core-js to add support to these browsers.

In the PDF 417 decoder recent addition, the library now makes use of the new BigInt type, which is not supported by all browsers as well. There's no way to polyfill that and ponyfill libraries are way to big, but even if PDF 417 decoding relies on BigInt the rest of the library shall work ok in browsers that doesn't support it.

There's no polyfills for BigInt in the way it's coded in here.

Usage

// use with commonJS
const { MultiFormatReader, BarcodeFormat } = require('@zxing/library');
// or with ES6 modules
import { MultiFormatReader, BarcodeFormat } from '@zxing/library';

const hints = new Map();
const formats = [BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX/*, ...*/];

hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);

const reader = new MultiFormatReader();

const luminanceSource = new RGBLuminanceSource(imgByteArray, imgWidth, imgHeight);
const binaryBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource));

reader.decode(binaryBitmap, hints);

Contributing

See Contributing Guide for information regarding porting approach and reasoning behind some of the approaches taken.

Contributors

Special thanks to all the contributors who have contributed for this project. We heartly thankful to you all.

And a special thanks to @aleris who created the project itself and made available the initial QR code port.


Related repositories
zxing/zxing

ZXing ("Zebra Crossing") barcode scanning library for Java, Android

JavaMavenApache License 2.0javaandroid
34k9.4k
TommyLemon/Android-ZBLibrary

🔥 Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架。 🔥 An Android MVP Framework with many demos, detailed documents, simple usages and strict codes.

JavaMavenApache License 2.0zxingokhttp
5.6k1.4k
jenly1314/ZXingLite

🔥 ZXing的精简极速版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成扫码更简单。

KotlinApache License 2.0zxingzxing-library
jenly1314.github.io/ZXingLite/
3.4k512
MxABC/LBXScan

A barcode and qr code scanner (二维码、扫码、扫一扫、ZXing、ZBar、iOS系统AVFoundation扫码封装,扫码界面效果封装)

Objective-CMIT Licensescanzbar
3.2k684
schmich/instascan

HTML5 QR code scanner using your webcam

JavaScriptnpmMIT Licensehtml5qr-code
schmich.github.io/instascan/
3k854
markusfisch/BinaryEye

Yet another barcode scanner for Android

KotlinMIT Licenseandroidkotlin-android
play.google.com/store/apps/details
2.3k173
yuzhiqiang1993/zxing

基于zxing的扫一扫,优化了扫描二维码速度,集成最新版本的jar包(zxing-core.jar 3.3.3),集成简单,速度快,可配置颜色,还有闪光灯,解析二维码图片,生成二维码等功能

JavaMavenMIT Licensezxinggoogle-zxing
blog.csdn.net/yuzhiqiang_1993/article/details/78292004
2.1k379
dlazaro66/QRCodeReaderView

Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes

JavaMavenandroidzxing
1.9k487
shouzhong/Scanner

二维码/条码识别、身份证识别、银行卡识别、车牌识别、图片文字识别、黄图识别、驾驶证(驾照)识别

JavaMavenidcardbankcard
1.5k371
OCNYang/QBox

:cat2: RxJava+Retrofit+Okhttp+Glide + A life tool App, contains modules: news; jokes; constellation fortune; LED; weather; calendar; two-dimensional code, and more ... 小秋魔盒是一个生活工具 App,主要功能有:新闻资讯;微信精选美文;笑话趣图;星座运势;LED字幕;天气;日历;二维码;手电筒;老黄历。在开发中尽可能多的用了目前比较流行的框架和库。

JavaMavenandroidrxjava
juejin.im/post/5a320ffb51882561a20a7d5d
1.4k332
yuriy-budiyev/code-scanner

Code scanner library for Android, based on ZXing

JavaMavenMIT Licenseandroidcode
1.2k279
devilsen/CZXing

Make you have the QRCode Scan ability like WeChat!

C++androidqrcode-scanner
1.1k174