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

@altack/quar

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altack/quar

A simple Angular QR Code scanner that just works.

  • 1.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
215
decreased by-29.51%
Maintainers
1
Weekly downloads
 
Created
Source

Quar

A simple Angular QR Code scanner that just works.

How to use?
  1. Install the package
    npm i @altack/quar

    Make sure to also install jsQR as a dependency. jsQR is used to decode the video stream captured by the user's camera until a match is found.

  2. Import the QuarModule in your AppModule (or any other module).

  3. Attach the <quar-scanner (scanSuccess)="onSuccess($event)" (scanError)="onError($event)"></quar-scanner> component to your desired component template.

Side notes
  • Most common use case is to attach the <quar-scanner></quar-scanner> into a fullscreen MatDialog component so that the scanner nicely appears on top of everything.

  • There's also a helper service QuarService it contains some functions to check for browser compatibility and user permissions

  • (onSuccess) event will emit only if jsQR found a valid QR Code, then Quar will stop looking for matches. You can restart the process by calling resumeScanner() directly from the QuarComponent e.g

    @ViewChild(QuarComponent) private quar: QuarComponent;

    restartScanning() { this.quar.resumeScanner(); }

  • (scanError) will emit in case the browser doesn't support WebRTC APIs, or it lacks of user permissions. Values are part of the QuarErrors Enum, and the possible values are noPermissions, notSupported or unknownError.

Angular Compatibility

If you're using Angular 15 make sure to update Quar package to v1.5.x

Keywords

FAQs

Package last updated on 23 Dec 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