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

qreader

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qreader

QR Code Scanner written in Typescript

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

QReader - Typescript QR Code Scanner

QReader is a JavaScript library that provides an easy-to-use QR code scanner using a video element. It allows you to integrate QR code scanning functionality into web applications with minimal setup.

Note! This library is in a very early development stage, and may contain bugs.

Installation

You can install QReader via npm:

npm install qreader

Usage

import QReader from 'qreader';

// Assuming you have a <video> element in your HTML
const videoElement = document.createElement('video');
document.body.appendChild(videoElement);

const qreader = new QReader(videoElement, onScanCallback);

function onScanCallback(data) {
    console.log('QR Code scanned:', data);
    // Handle the scanned QR code data here
}

// Start scanning
qreader.resumeScanning();

// Pause scanning
// qreader.pauseScanning();

// Destroy instance when done
// qreader.destroyInstance();

Constructor

import QReader from 'qreader';

const qreader = new QReader(videoElement, onScan, options?);

Methods

MethodDescription
pauseScanning()Pauses QR code scanning.
resumeScanning()Resumes QR code scanning.
destroyInstance()Stops the QR code scanner and cleans up resources.

Properties

PropertyTypeDescription
latestScanstring | nullContains the latest scanned QR code data, or null if no QR code has been scanned yet.
isCameraActivebooleanIndicates whether the camera is actively scanning for QR codes.
isScanningPausedbooleanIndicates whether the scanning process is currently paused.

Keywords

FAQs

Package last updated on 08 Jul 2024

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