@sensorfactdev/qr-code-scanner

1.0.10 • Public • Published

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

Key Type Default Value
onQrCodeScanned Function console.log
width Number window.innerWidth
height Number window.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

Readme

Keywords

none

Package Sidebar

Install

npm i @sensorfactdev/qr-code-scanner

Weekly Downloads

14

Version

1.0.10

License

MIT

Last publish

Collaborators

  • thomas.molina.sensorfact
  • chung225
  • rui.loureiro
  • silikerbil
  • rodrigo_ss
  • tinakuzmenko_sensorfact
  • manonww
  • sabina.tursunkhanova
  • wellett-sensorfact
  • merlinde.wobben
  • sfdgamboa
  • thijssensorfact
  • iskren_sensorfact
  • mzubova
  • paco.trujillo
  • avladd
  • hector.sensorfact
  • kiliangrashoff
  • karimcitoh
  • zoiderberg_nl