shaken-qr-reader
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

shaken-qr-reader

npm version Libraries.io dependency status for GitHub repo npm bundle size npm GitHub

shaken-qr-reader is a library to read/parse Japanese 車検証 QR code

Installation

NPM

npm install shaken-qr-reader --save
yarn add shaken-qr-reader

Browser

You can find the script URL from https://www.jsdelivr.com/package/npm/shaken-qr-reader

Usage

const images = ... // common ImageData type objects. You can get from cameras or uploaded files etc...
const reader = new ShakenQRReader(); 
// const reader = new ShakenQRReader('kei'); for 軽自動車 has 6 QR codes
// const reader = new ShakenQRReader('kei_old'); for 軽自動車 has 3 QR codes

images.forEach((image) => {
    try {
        reader.push(image);
    } catch (error) {
        if (error instanceof InvalidQRCode) {
            console.log("The image is not valid shaken QR code.");
        } else if (error instanceof ReadQRCocde) {
            console.log("The image is already read.");
        }
    }
});

console.log(reader.isCompleted); // Whether all the QR codes are read or not
console.log(reader.missingIndex); // Indexs for the QR code which is not read
console.log(reader.result);

see example directory for real usage.

Development

Install dependencies

yarn

Run tests

yarn test

Run lint

yarn lint

License

see LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i shaken-qr-reader

Weekly Downloads

9

Version

1.1.6

License

MIT

Unpacked Size

255 kB

Total Files

61

Last publish

Collaborators

  • aya-vii
  • seibii-inc
  • amato
  • sndyut0089