{"_id":"@blackbox-vision/use-torch-light","_rev":"5-fd2c27954801548847993cfa4f5891bd","name":"@blackbox-vision/use-torch-light","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@blackbox-vision/use-torch-light","description":"A hook to enable/disable camera flash","version":"0.0.1","license":"MIT","pika":true,"sideEffects":false,"keywords":["react","torch","torchlight","react-hooks"],"homepage":"https://github.com/BlackBoxVision/use-torch-light#readme","bugs":{"url":"https://github.com/BlackBoxVision/use-torch-light/issues"},"repository":{"type":"git","url":"git+https://github.com/BlackBoxVision/use-torch-light.git"},"dependencies":{},"peerDependencies":{"react":"~16","react-dom":"~16"},"devDependencies":{"@babel/core":"^7.9.0","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-proposal-object-rest-spread":"^7.9.0","@babel/plugin-proposal-optional-chaining":"^7.9.0","@babel/preset-react":"^7.9.1","@babel/preset-typescript":"^7.9.0","@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@pika/pack":"^0.5.0","@pika/plugin-build-node":"^0.9.2","@pika/plugin-build-types":"^0.9.2","@pika/plugin-build-web":"^0.9.2","@pika/plugin-standard-pkg":"^0.9.2","@types/react":"^16.9.25","@types/w3c-image-capture":"^1.0.2","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","eslint":"^6.8.0","eslint-config-react-app":"^5.2.1","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-react":"^7.19.0","eslint-plugin-react-hooks":"^2.5.1","husky":"^4.2.3","lint-staged":"^10.0.8","prettier":"^2.0.0","react":"^16.13.1","react-docgen-typescript-loader":"^3.7.1","react-dom":"^16.13.1","source-map-explorer":"^2.4.1","ts-loader":"^6.2.1","typescript":"^3.8.3"},"esnext":"dist-src/index.js","main":"dist-node/index.js","module":"dist-web/index.js","types":"dist-types/index.d.ts","_id":"@blackbox-vision/use-torch-light@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"jonatansalas","email":"jonatan.salas@blackbox-vision.tech"},"dist":{"integrity":"sha512-jS09/Q8xJuYt8WxCnQ8vLGtIL0Bi11TuoGUEAgM07yJ9Vx/mhKip0pHZNS0oDY+dGS0m6d8vYrSEiYfrmWU6eg==","shasum":"f4af33a5cba7bdef8530babe5bce522e2d557adc","tarball":"https://registry.npmjs.org/@blackbox-vision/use-torch-light/-/use-torch-light-0.0.1.tgz","fileCount":13,"unpackedSize":29044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeYnjCRA9TVsSAnZWagAAP0UP+gL77UTvsKZwxjRbGdbf\nHJWtOwLl6xwjjAi/p7Y694jg2DkZvs60HztSuo2/oXP06MmbKcx4BhaMmUbi\n6SpEFWsfLnbUMyG7nw1PpJVwBk6ZCxUuya9Xh9aIdz7a5VhWvbzEyXScdhpy\nlkp4yLXNkrBZ+/Gjy0cNk80/6eDX9/evdRRS1RFte8dUXEaxMRJS0GfXwVLk\nuKZenoAapl7KmHXBZx5F6WZf8lsRK+T52kufBg9U87VpEm2R/qfQkBtWfkfy\nrlQY8DhZL9HNaw0GZkpcB7ojSsQjppKUthKhNQZq3GEtlobUW/EY4hgz8IOc\nA6Ig5JJ6OeYiAmDN4pjcbwP+Z5ahR47G0miIq9j+O4jUbTPi+2dwRZ7lnK5t\n5FbBBAho5iXOJaPkRN2YQcZayoVTteGGzs3GMDCHoPjVmyXMIKsNm24QGAhh\neNpjbHaJJ1Y/4R7bukp3cdx2414cMJYTESIlhPr6QjU9PX7G5Ds1XWzgTkQD\nxyQbabQhduwIw+X059XsKYoZVWYci5GFXM3z3yb/uDoJKVrTwjCn4dVimJSQ\nQDclMMujdVu7sbNjZ/idN8BVc2D9hQP48KCYxVoXVJpqOO+5l6TtgZTcE7pJ\nrq1atTbxnctQLfxG++XYZ8J+HnkL/BYdUoD4K4+twK1LL2N31se3vFj9WraL\n/mcn\r\n=ktMe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5fRFYt2gkG71h3j5xLZ9Tpxvqq73+21NWsx1rjLaxkAiA1fgK0tPYOFMs8Oj8sjzsmU1GNglpEIHrhE7FWojoLZQ=="}]},"maintainers":[{"name":"manutuero","email":"manuel.tuero@blackbox-vision.tech"},{"name":"jonatansalas","email":"jonatan.salas@blackbox-vision.tech"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-torch-light_0.0.1_1585023459462_0.7781676046337813"},"_hasShrinkwrap":false},"0.0.2":{"name":"@blackbox-vision/use-torch-light","description":"A hook to enable/disable camera flash","version":"0.0.2","license":"MIT","pika":true,"sideEffects":false,"keywords":["react","torch","torchlight","react-hooks"],"homepage":"https://github.com/BlackBoxVision/use-torch-light#readme","bugs":{"url":"https://github.com/BlackBoxVision/use-torch-light/issues"},"repository":{"type":"git","url":"git+https://github.com/BlackBoxVision/use-torch-light.git"},"dependencies":{},"peerDependencies":{"react":"~16","react-dom":"~16"},"devDependencies":{"@babel/core":"^7.9.0","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-proposal-object-rest-spread":"^7.9.0","@babel/plugin-proposal-optional-chaining":"^7.9.0","@babel/preset-react":"^7.9.1","@babel/preset-typescript":"^7.9.0","@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@pika/pack":"^0.5.0","@pika/plugin-build-node":"^0.9.2","@pika/plugin-build-types":"^0.9.2","@pika/plugin-build-web":"^0.9.2","@pika/plugin-standard-pkg":"^0.9.2","@types/react":"^16.9.25","@types/w3c-image-capture":"^1.0.2","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","eslint":"^6.8.0","eslint-config-react-app":"^5.2.1","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-react":"^7.19.0","eslint-plugin-react-hooks":"^2.5.1","husky":"^4.2.3","lint-staged":"^10.0.8","prettier":"^2.0.0","react":"^16.13.1","react-docgen-typescript-loader":"^3.7.1","react-dom":"^16.13.1","source-map-explorer":"^2.4.1","ts-loader":"^6.2.1","typescript":"^3.8.3"},"esnext":"dist-src/index.js","main":"dist-node/index.js","module":"dist-web/index.js","types":"dist-types/index.d.ts","_id":"@blackbox-vision/use-torch-light@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"jonatansalas","email":"jonatan.salas@blackbox-vision.tech"},"dist":{"integrity":"sha512-yvmzv2O43JpgL1F1DZRvGF79lfPg0zreV55V3uLXsXfnhC/HG5BXStIb70uZ/1XclIrhtyhmO0uLG+HIIsUPKQ==","shasum":"0f5c4681a5807c278de1a042070901ce17a3df9a","tarball":"https://registry.npmjs.org/@blackbox-vision/use-torch-light/-/use-torch-light-0.0.2.tgz","fileCount":13,"unpackedSize":34916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2Bj4CRA9TVsSAnZWagAApg8P/3wzXkNFV0OM4Dvawu4k\nmeQmRRfLrymYU0hOYcvfoJyYRSstUu6+sZQ9AMd0BWiMatAuLXiA7xRbfVSl\nLucMqy/mjOf6Df3TCPFq/coVNwDgaJUaOrNL6EZ1SeiznYE7Q9xrzE9HH82Y\n3TmpkP1BEGraOa3ePK88/tfRHulfTImR+ANX4cTErIZ60Op8x8ach1OL7mYQ\nz8exS+t9gOTOVxy//lR4x5mpcf0LiphrsGOPqIGvpTKQ8CSFww+AuJfnlo+2\nlWOFfVX9vepbQCg0bleP9CfiXwo5n+giXNmbFkL0cbCyhttzsHc5+hO3mKP/\njlgyCUN5oWGLc+DAQUhtfbAB6autfnsMYWAW6O00k3Pkeuo8wPmM7MED2KkZ\nhBQfUZhl7IQajWGt0VaUJiQGWnPuygHiq5pmC/cWzvrhoBCEvbC3wLjHprDq\nDOS+C2kfbbetkAqVpIlCtNAZe2ZHdR0PmWeTKO8DD60spshTub9UNBP+OeN9\nReMbnZdcHm1KoZdQSv9gcclfDi8+ry7DsWExtcsygMFFeZtzLTcsn38QQnYJ\nDzdRFpV/BV2xgbt9b2L3Ih2EHWAp431/DvCxWukmnFLsL3ZXBiUb3PG8ip8n\nXO1j8vi7+saTTbJKN5ce/7WSE0PkDRkiY+TNODzK2HSwU0QvsV053Uws7gP5\nSdc3\r\n=B/nv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg0s7EoxELTO3nz2AHPR9vparaIRCboRl6EuVmnkyc3AIgLinQ0WtTHRQSZiYwcdWB3SldYDXip9RYW9hr7Pl53u0="}]},"maintainers":[{"name":"jonatansalas","email":"jonatan.salas@blackbox-vision.tech"},{"name":"manutuero","email":"manuel.tuero@blackbox-vision.tech"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-torch-light_0.0.2_1585055871920_0.4314102429824509"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-24T04:17:39.266Z","0.0.1":"2020-03-24T04:17:39.561Z","modified":"2022-04-04T19:19:57.739Z","0.0.2":"2020-03-24T13:17:52.047Z"},"maintainers":[{"email":"jonatan.salas@blackbox-vision.tech","name":"jonatansalas"},{"email":"manuel.tuero@blackbox-vision.tech","name":"manutuero"}],"description":"A hook to enable/disable camera flash","homepage":"https://github.com/BlackBoxVision/use-torch-light#readme","keywords":["react","torch","torchlight","react-hooks"],"repository":{"type":"git","url":"git+https://github.com/BlackBoxVision/use-torch-light.git"},"bugs":{"url":"https://github.com/BlackBoxVision/use-torch-light/issues"},"license":"MIT","readme":"# UseTorchLight [![npm version](https://badge.fury.io/js/%40blackbox-vision%2Fuse-torch-light.svg)](https://badge.fury.io/js/%40blackbox-vision%2Fuse-torch-light) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![Known Vulnerabilities](https://snyk.io/test/github/blackboxvision/use-torch-light/badge.svg)](https://snyk.io/test/github/blackboxvision/use-torch-light)\n\n🔦 **useTorchLight** is a hook to enable/disable camera flash. Check out the [demo](https://zittu.csb.app).\n\n## Install\n\nYou can install this library via NPM or YARN.\n\n### NPM\n\n```bash\nnpm i @blackbox-vision/use-torch-light\n```\n\n### YARN\n\n```bash\nyarn add @blackbox-vision/use-torch-light\n```\n\n## Usage\n\nThe usage is really simple:\n\n```javascript\nimport React, { useState, useRef } from 'react';\nimport { QrReader } from '@blackbox-vision/react-qr-reader';\nimport { useTorchLight } from '@blackbox-vision/use-torch-light';\n\nconst Test = (props) => {\n  const streamRef = useRef(null);\n\n  const [error, setError] = useState(null);\n  const [data, setData] = useState('No result');\n\n  const [on, toggle] = useTorchLight(streamRef.current);\n\n  const setRef = ({ stream }) => {\n    streamRef.current = stream;\n  };\n\n  return (\n    <>\n      <QrReader\n        onLoad={setRef}\n        onScan={setData}\n        onError={setError}\n        style={{ width: '100%' }}\n      />\n      <button onClick={toggle}>{on ? 'Disable Torch' : 'Enable Torch'}</button>\n      <p>{JSON.stringify(data, null, 2)}</p>\n      <p>{JSON.stringify(error, null, 2)}</p>\n    </>\n  );\n};\n```\n\n## Issues\n\nPlease, open an [issue](https://github.com/BlackBoxVision/use-torch-light/issues) following one of the issues templates. We will do our best to fix them.\n\n## Contributing\n\nIf you want to contribute to this project see [contributing](https://github.com/BlackBoxVision/use-torch-light/blob/master/CONTRIBUTING.md) for more information.\n\n## License\n\nDistributed under the **MIT license**. See [LICENSE](https://github.com/BlackBoxVision/use-torch-light/blob/master/LICENSE) for more information.\n","readmeFilename":"README.md"}