Skip to content
🤘Tool for decoding qrcode by image,video or camera.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
config
demo feat: update demo Jan 15, 2019
doc
src
test
.babelrc
.editorconfig feat: init project Nov 20, 2018
.eslintignore
.eslintrc.js
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
README.zh-CN.md
TODO.md feat: init project Nov 20, 2018
package.json fix: clear black bg after camera capture Jan 15, 2019
yarn.lock

README.md

qrcode-decoder

license Build Status NPM downloads

简体中文 | 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 npm to install.

$ npm install --save qrcode-decoder

Using in webpack:

import QrcodeDecoder from 'qrcode-decoder';

Using in browser:

<script src="node_modules/qrcode-decoder/dist/index.aio.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:

$ npm install

Build code:

$ npm run build

Run unit test:

$ npm test

Modify version in package.json, run release script:

$ npm run release

Publish

$ npm publish

License

MIT

You can’t perform that action at this time.