Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.
Installations
npm install @zxing/library
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 10.4.0
Node Version
18.20.4
NPM Version
10.7.0
Score
99.3
Supply Chain
99.4
Quality
81.1
Maintenance
100
Vulnerability
80.9
License
Releases
Contributors
Languages
TypeScript (94.15%)
Java (5.69%)
JavaScript (0.16%)
Developer
Download Statistics
Total Downloads
32,850,690
Last Day
15,537
Last Week
177,702
Last Month
1,079,750
Last Year
12,833,281
GitHub Statistics
2,536 Stars
1,211 Commits
548 Forks
46 Watching
14 Branches
56 Contributors
Package Meta Information
Latest Version
0.21.3
Package Id
@zxing/library@0.21.3
Unpacked Size
9.02 MB
Size
1.46 MB
File Count
1,346
NPM Version
10.7.0
Node Version
18.20.4
Publised On
21 Aug 2024
Total Downloads
Cumulative downloads
Total Downloads
32,850,690
Last day
-68.4%
15,537
Compared to previous day
Last week
-31.2%
177,702
Compared to previous week
Last month
-7.6%
1,079,750
Compared to previous month
Last year
31.4%
12,833,281
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
35
Optional Dependencies
1
ZXing
Project in Maintenance Mode Only
The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enhancements will be considered. The Barcode Scanner app can no longer be published, so it's unlikely any changes will be accepted for it. There is otherwise no active development or roadmap for this project. It is "DIY".
Runs on your favorite ECMAScript ecosystem
If it doesn't, we gonna make it.
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 | ||
RSS-14 | ||
RSS-Expanded (not production ready!) |
Status
Attention
NOTE: While we do not have the time to actively maintain zxing-js anymore, we are open to new maintainers taking the lead.
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
1// use with commonJS 2const { MultiFormatReader, BarcodeFormat } = require('@zxing/library'); 3// or with ES6 modules 4import { MultiFormatReader, BarcodeFormat } from '@zxing/library'; 5 6const hints = new Map(); 7const formats = [BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX/*, ...*/]; 8 9hints.set(DecodeHintType.POSSIBLE_FORMATS, formats); 10 11const reader = new MultiFormatReader(); 12 13const luminanceSource = new RGBLuminanceSource(imgByteArray, imgWidth, imgHeight); 14const binaryBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource)); 15 16reader.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.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
Found 5/11 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/zxing-js/library/stale.yml/master?enable=pin
- Info: 0 out of 10 GitHub-owned GitHubAction dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 25 are checked with a SAST tool
Reason
18 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc
Score
4
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @zxing/library
vue-zxing
基于zxing-js/library插件封装的vue组件,组件可以扫描解析二维码、条形码。
@nuintun/qrcode
A pure JavaScript QRCode encode and decode library.
zxing-library2
TypeScript port of ZXing multi-format 1D/2D barcode image processing library with inverse barcode support
zxing-library-with-attempts
TypeScript port of ZXing multi-format 1D/2D barcode image processing library.