Skip to content

Latest commit

 

History

History
95 lines (57 loc) · 1.98 KB

modules.md

File metadata and controls

95 lines (57 loc) · 1.98 KB

qr-scanner-cli / Exports

qr-scanner-cli

Table of contents

Interfaces

Type aliases

Functions

Type aliases

Flags

Ƭ Flags: Object

Type declaration

Name Type
clear? boolean
clipboard? boolean
open? boolean

Defined in

src/cli/flags.ts:1

Functions

scanFromBitmap

Const scanFromBitmap(bitmap, flags?): Promise<string>

You can pass a jimp Bitmap, this functions reads it's content and tries to find a QR Code, returning it's result

import Jimp from 'jimp'

const bitmap = Jimp.read('./image.jpg')
const value = await scanFromBitmap(bitmap)

Parameters

Name Type Description
bitmap Bitmap A Bitmap object
flags? Flags

Returns

Promise<string>

Value read from the QR Code inside the image

Defined in

src/pipelines/scanFromBitmap.ts:20


scanFromFile

Const scanFromFile(filePath, flags?): Promise<string>

This function reads a file, get it's bitmap, searches and read a qrcode from it.

const value = await scanFromFile('./image.jpg')

Parameters

Name Type Description
filePath string A file path for an image file containing a QR Code
flags? Flags

Returns

Promise<string>

Value read from the QR Code inside the image

Defined in

src/pipelines/scanFromFile.ts:17