
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@react-barcode-scanner/hooks
Advanced tools
A set of React hooks for using a webcam as a barcode scanner.
A set of React hooks for using a webcam as a barcode scanner.
Created as part of a project for making a UPC reader for board games, the scanner is not 100% reliable with modern smartphones. The presence of multiple cameras and the inability to easily choose the correct camera forces several compromises.
The built-in BarcodeDetector
API is used when available. When it is not
available, the @undecaf/barcode-detector-polyfill
is used instead.
Reference the Storybook stories
(demo site)
for an example of implementation, as well as the companion package
@react-barcode-scanner/components
.
The primary hook useBarcodeScanner
should have a relatively self-documenting
API, but here are the available options:
zoom
: an integer providing the amount of zoom to apply, defaults to 1
onDevices
: a callback function to execute when the list of devices is
available. This can be useful if you want to allow the user to select a deviceonScan
: a callback function to execute when the scanner detects a barcode.
Will contain the logic to interface with your code.shouldPlay
: determines whether or not the video element will automatically
begin playing after permission to use the camera is granted. When set to false
you will need to manually start the scanner's video element playing. Defaults
to true
.There are many lower level hooks used by the primary hook which can also be explored separately.
FAQs
A set of React hooks for using a webcam as a barcode scanner.
The npm package @react-barcode-scanner/hooks receives a total of 269 weekly downloads. As such, @react-barcode-scanner/hooks popularity was classified as not popular.
We found that @react-barcode-scanner/hooks 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.