Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openhealthnz-credentials/pdf-image-qr-scanner

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openhealthnz-credentials/pdf-image-qr-scanner

Library to scan user-uploaded PDF's or images locally and reliably for QR codes using jsQR.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
130
decreased by-24.42%
Maintainers
4
Weekly downloads
 
Created
Source

pdf-image-qr-scanner

License Build Status NPM Package semantic-release

Library to scan user-uploaded PDF's or images locally and reliably for QR codes using jsQR.

Install

npm install @openhealthnz-credentials/pdf-image-qr-scanner # or
yarn add @openhealthnz-credentials/pdf-image-qr-scanner

Use

import { scanFile } from "@openhealthnz-credentials/pdf-image-qr-scanner";
...
try {
    // selectedFile: File (https://developer.mozilla.org/en-US/docs/Web/API/File)
    const qrCode = await scanFile(selectedFile);
    // It returns null if no QR code is found
    console.log(qrCode || "No QR code found");
} catch (e) {
    // Example Error Handling
    if (e?.name === "InvalidPDFException") {
        console.log("Invalid PDF");
    } else if (e instanceof Event) {
        console.log("Invalid Image");
    } else {
        console.log("Unknown error:", e);
    }
}

Additional examples available in the the examples folder.

TODO:

  • Implement AVA tests with browser polyfills.

Supported By

Keywords

FAQs

Package last updated on 17 Jan 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc