
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@blackbox-vision/use-torch-light
Advanced tools
🔦 useTorchLight is a hook to enable/disable camera flash. Check out the demo.
You can install this library via NPM or YARN.
npm i @blackbox-vision/use-torch-light
yarn add @blackbox-vision/use-torch-light
The usage is really simple:
import React, { useState, useRef } from 'react';
import { QrReader } from '@blackbox-vision/react-qr-reader';
import { useTorchLight } from '@blackbox-vision/use-torch-light';
const Test = (props) => {
const streamRef = useRef(null);
const [error, setError] = useState(null);
const [data, setData] = useState('No result');
const [on, toggle] = useTorchLight(streamRef.current);
const setRef = ({ stream }) => {
streamRef.current = stream;
};
return (
<>
<QrReader
onLoad={setRef}
onScan={setData}
onError={setError}
style={{ width: '100%' }}
/>
<button onClick={toggle}>{on ? 'Disable Torch' : 'Enable Torch'}</button>
<p>{JSON.stringify(data, null, 2)}</p>
<p>{JSON.stringify(error, null, 2)}</p>
</>
);
};
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 hook to enable/disable camera flash
The npm package @blackbox-vision/use-torch-light receives a total of 484 weekly downloads. As such, @blackbox-vision/use-torch-light popularity was classified as not popular.
We found that @blackbox-vision/use-torch-light demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.