Options
All
  • Public
  • Public/Protected
  • All
Menu

Project qr-scanner-cli

Interfaces

Type aliases

Functions

Type aliases

Flags

Flags: object

Type declaration

  • Optional clear?: boolean
  • Optional clipboard?: boolean
  • Optional open?: boolean

Functions

Const scanFromBitmap

  • scanFromBitmap(bitmap: Bitmap, flags?: 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

    Returns Promise<string>

    Value read from the QR Code inside the image

Const scanFromFile

  • scanFromFile(filePath: string, flags?: 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

    • filePath: string

      A file path for an image file containing a QR Code

    • Optional flags: Flags

    Returns Promise<string>

    Value read from the QR Code inside the image

Generated using TypeDoc