Socket
Socket
Sign inDemoInstall

@trungdq88/qr-code-scanner

Package Overview
Dependencies
36
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @trungdq88/qr-code-scanner

Scan QR codes using the rear camera of a phone inside React


Version published
Weekly downloads
4
Maintainers
1
Install size
5.16 MB
Created
Weekly downloads
 

Readme

Source

QR Code Scanner

Build Status Known Vulnerabilities npm version Package Quality

Usage

import QrCodeScanner from '@sensorfactdev/qr-code-scanner';

const handleScanResult = result => {
  console.log(result);
  // {
  //   "result": "RESULT STRING VALUE",
  //   "points": [
  //     {
  //       "x": 171,
  //       "y": 445,
  //       "count": 2,
  //       "estimatedModuleSize": 3.857142857142857
  //     },
  //     // .... more points
  //   ]
  // }
}

const MyApp = () => (
  <div>
    <QrCodeScanner
      onQrCodeScanned={handleScanResult}
      width={window.innerWidth}
      height={window.innerHeight}
      showAimAssist // Defaults to true, disable to remove the aim assist
    />
  </div>
)

Props

KeyTypeDefault Value
onQrCodeScannedFunctionconsole.log
widthNumberwindow.innerWidth
heightNumberwindow.innerHeight

Development

To start Storybook:

yarn start

To run the tests:

yarn test

To run tests in watch mode:

yarn test --watch

Building the module

yarn build

FAQs

Last updated on 27 Feb 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc