Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seibii/shaken-qr-reader
A frontend library for Japanese 車検証 QR code
https://github.com/seibii/shaken-qr-reader
automobile car inspection javascript qrcode typescript
Last synced: 2 months ago
JSON representation
A frontend library for Japanese 車検証 QR code
- Host: GitHub
- URL: https://github.com/seibii/shaken-qr-reader
- Owner: seibii
- License: mit
- Created: 2020-08-31T09:06:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T02:57:42.000Z (almost 2 years ago)
- Last Synced: 2024-08-08T17:44:20.526Z (6 months ago)
- Topics: automobile, car, inspection, javascript, qrcode, typescript
- Language: TypeScript
- Homepage: https://github.com/seibii/shaken-qr-reader
- Size: 5.25 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shaken-qr-reader
[![npm version](https://badge.fury.io/js/shaken-qr-reader.svg)](https://badge.fury.io/js/shaken-qr-reader)
[![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/seibii/shaken-qr-reader.svg)](https://libraries.io/github/seibii/shaken-qr-reader)
![npm bundle size](https://img.shields.io/bundlephobia/min/shaken-qr-reader.svg)
![npm](https://img.shields.io/npm/dt/shaken-qr-reader.svg)
![GitHub](https://img.shields.io/github/license/seibii/shaken-qr-reader.svg)`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
```typescript
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 codesimages.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](./LICENSE)