File: README.md

package info (click to toggle)
node-html5-qrcode 2.3.8%2Brepack-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,284 kB
  • sloc: javascript: 18,686; makefile: 15; sh: 14
file content (33 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# html5-qrcode with electron
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Electron_Software_Framework_Logo.svg/1024px-Electron_Software_Framework_Logo.svg.png" width="200px"><br>
[www.electronjs.org](https://https://www.electronjs.org/) | `Support Level` = `Strong`

## How to build a `electronjs` app using `html5-qrcode`

### Download the latest library
You can download this from [Github release page](https://github.com/mebjas/html5-qrcode/releases) or [npm](https://www.npmjs.com/package/html5-qrcode). And include this in `index.html`.

```html
<script src="html5-qrcode.min.js"></script>
```

### And include the `html` placeholder
```html
<div style="width: 600px" id="reader"></div>
```

### And `javascript` initialization
```js
function onScanSuccess(decodedText, decodedResult) {
    // Handle on success condition with the decoded message.
    console.log(`Scan result ${decodedText}`, decodedResult);
}
var html5QrcodeScanner = new Html5QrcodeScanner(
    "reader", { fps: 10, qrbox: 250 });
html5QrcodeScanner.render(onScanSuccess);
```

## Run the app
```cmd
npm start
```