Gathering detailed insights and metrics for react-qr-reader-es6
Gathering detailed insights and metrics for react-qr-reader-es6
Gathering detailed insights and metrics for react-qr-reader-es6
Gathering detailed insights and metrics for react-qr-reader-es6
react-qr-reader
A React Component for reading QR codes from the webcam
@types/react-qr-reader
TypeScript definitions for react-qr-reader
@blackbox-vision/react-qr-reader
A React Component for reading QR codes from the webcam
react-qr-code
A QR code generator for React and React Native.
npm install react-qr-reader-es6
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
204 Commits
3 Forks
13 Branches
1 Contributors
Updated on 09 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
7%
137
Compared to previous day
Last week
-8.3%
722
Compared to previous week
Last month
58.1%
3,079
Compared to previous month
Last year
-42.8%
43,219
Compared to previous year
This project is adopted from react-qr-reader. I made a few changes:
In the end, it reduced the final lib from 140KB+ to 60KB+.
A React component for reading QR codes from the webcam. It uses the WebRTC standards for reading webcam data and jsQR is used for detecting QR codes in that data. To optimise the speed and experience, a web-worker is used to offload the heavy QR code algorithm on a separate process. The web worker is inlined and loaded on creation of the component.
https://jodusnodus.github.io/react-qr-reader
facingMode
will not affect it.npm install --save react-qr-reader-es6
1import React, { Component } from 'react' 2import QrReader from 'react-qr-reader-es6' 3 4class Test extends Component { 5 state = { 6 result: 'No result' 7 } 8 9 handleScan = data => { 10 if (data) { 11 this.setState({ 12 result: data 13 }) 14 } 15 } 16 handleError = err => { 17 console.error(err) 18 } 19 render() { 20 return ( 21 <div> 22 <QrReader 23 delay={300} 24 onError={this.handleError} 25 onScan={this.handleScan} 26 style={{ width: '100%' }} 27 /> 28 <p>{this.state.result}</p> 29 </div> 30 ) 31 } 32} 33
Prop | Argument | Description |
---|---|---|
onScan | result | Scan event handler. Called every scan with the decoded value or null if no QR code was found. |
onError | Error | Called when an error occurs. |
onLoad | object | Called when the component is ready for use. Object properties are mirrorVideo : boolean, streamLabel : string |
onImageLoad | img onLoad event | Called when the image in legacyMode is loaded. |
Prop | Type | Default | Description |
---|---|---|---|
delay | number or false | 500 | The delay between scans in milliseconds. To disable the interval pass in false . |
facingMode | user or environment | environment | Specify which camera should be used (if available). |
resolution | number | 600 | The resolution of the video (or image in legacyMode). Larger resolution will increase the accuracy but it will also slow down the processing time. |
style | a valid React style | none | Styling for the container element. Warning The preview will always keep its 1:1 aspect ratio. |
className | string | none | ClassName for the container element. |
showViewFinder | boolean | true | Show or hide the build in view finder. See demo |
constraints | object | null | Use custom camera constraints that the override default behavior. MediaTrackConstraints |
legacyMode | boolean | false | If the device does not allow camera access (e.g. IOS Browsers, Safari) you can enable legacyMode to allow the user to take a picture (On a mobile device) or use an existing one. To trigger the image dialog just call the method openImageDialog from the parent component. Warning You must call the method from a user action (eg. click event on some element). |
npm install
npm run build
npm run storybook
npm run lint
The MIT License (MIT)
Copyright (c) 2018 Thomas Billiet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
54 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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 More