1.2.0 • Published 5 years ago

@trungdq88/qr-code-scanner v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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
1.2.0

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago