Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@cmdnio/react-qr-reader
Advanced tools
A fork of a React Component for reading QR codes from the webcam
:rocket: React QR Reader component. Check out the demo.
We would remove the repo and a package as soon as the original package would support React 18
You need a component for Scanning QR codes from a web browser based app.
This component has been tested in the following browsers:
Since this library does internal use of hooks you need React >= 16.8.0
.
You can install this library via NPM or YARN.
npm i @cmdnio/react-qr-reader
yarn add @cmdnio/react-qr-reader
After reading and performing the previous steps, you should be able to import the library and use it like in this example:
import React, { useState } from 'react';
import { QrReader } from '@cmdnio/react-qr-reader';
const Test = (props) => {
const [data, setData] = useState('No result');
return (
<>
<QrReader
onResult={(result, error) => {
if (!!result) {
setData(result?.text);
}
if (!!error) {
console.info(error);
}
}}
style={{ width: '100%' }}
/>
<p>{data}</p>
</>
);
};
The QrReader
component has the following props:
Properties | Types | Default Value | Description |
---|---|---|---|
constraints | MediaTrackConstraints | { facingMode: 'user' } | Specify which camera should be used (if available). |
onResult | function | none | Scan event handler |
videoId | string | video | The ID for the video element |
scanDelay | number | 500 | The scan period for the QR hook |
ViewFinder | component | none | ViewFinder component to rendering over the video element |
className | string | none | ClassName for the container element. |
containerStyle | object | none | Style object for the container element. |
videoContainerStyle | object | none | Style object for the video container element. |
videoStyle | object | none | Style object for the video element. |
If you need to support older browsers, checkout this guide in how to make it compatible with legacy ones
Please, open an issue following one of the issues templates. We will do our best to fix them.
If you want to contribute to this project see contributing for more information.
Distributed under the MIT license. See LICENSE for more information.
FAQs
A fork of a React Component for reading QR codes from the webcam
The npm package @cmdnio/react-qr-reader receives a total of 27 weekly downloads. As such, @cmdnio/react-qr-reader popularity was classified as not popular.
We found that @cmdnio/react-qr-reader demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.