Nothing Special   »   [go: up one dir, main page]

Skip to content

yugasun/qrcode-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

41 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

npm NPM downloads license

็ฎ€ไฝ“ไธญๆ–‡ | English

A tool for decoding qrcode.

Directory

.
โ”œโ”€โ”€ demo            code demo
โ”œโ”€โ”€ dist            build output
โ”œโ”€โ”€ doc             docs
โ”œโ”€โ”€ src             source code
โ”œโ”€โ”€ test            unit test
โ”œโ”€โ”€ CHANGELOG.md    change log
โ””โ”€โ”€ TODO.md         todo list

Guide

Use pnpm to install.

$ pnpm install --save qrcode-decoder

Using in webpack:

import QrcodeDecoder from 'qrcode-decoder';

Using in browser:

<script src="https://unpkg.com/qrcode-decoder@0.3.1/dist/index.min.js"></script>

Demo

QrcodeDecoder()

User new to create a decoder object.

var qr = new QrcodeDecoder();

decodeFromImage(img, options)

Decodes an image from url or an <img> element with a src attribute set.

qr.decodeFromImage(img).then((res) => {
  console.log(res);
});

Demo

decodeFromVideo(videoElem, options)

Decodes directly from a video with a well specified src attribute

qr.decodeFromVideo(videoElement).then((res) => {
  console.log(res);
});

Demo

decodeFromCamera(videoElem, options)

Decodes from a videoElement.

qr.decodeFromCamera(videoElem).then((res) => {
  console.log(res);
});

Demo

stop()

Stops the current qr from searching for a QRCode.

Develop

Install dependencies:

$ pnpm install

Build code:

$ pnpm run build

Run unit test:

$ pnpm test

Modify version in package.json, run release script:

$ pnpm run release

Publish

$ pnpm publish

License

MIT