├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── RELEASE.md ├── assets ├── qr.png └── setup.jpg ├── deploy ├── deploy.sh ├── id_rsa.enc └── id_rsa.pub ├── docs ├── app.js ├── favicon.png ├── index.html └── style.css ├── export.js ├── gulpfile.js ├── index.js ├── package.json └── src ├── camera.js ├── scanner.js └── zxing.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | 4 | .idea/ 5 | yarn.lock 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | - '6' 3 | install: npm install 4 | script: gulp release 5 | env: 6 | global: 7 | - COMMIT_AUTHOR_NAME: "'Chris Schmich'" 8 | - COMMIT_AUTHOR_EMAIL: 'schmch@gmail.com' 9 | - ENCRYPTION_LABEL: 95f025fe7ce3 10 | deploy: 11 | provider: script 12 | script: bash ./deploy/deploy.sh 13 | skip_cleanup: true 14 | on: 15 | branch: master 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Chris Schmich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![Instascan](https://raw.githubusercontent.com/schmich/instascan/master/assets/qr.png) Instascan 2 | Real-time webcam-driven HTML5 QR code scanner. [Try the live demo](https://schmich.github.io/instascan/). 3 | 4 | ## Installing 5 | 6 | *Note:* Chrome requires HTTPS when using the WebRTC API. Any pages using this library should be served over HTTPS. 7 | 8 | ### NPM 9 | 10 | `npm install --save instascan` 11 | 12 | ```javascript 13 | const Instascan = require('instascan'); 14 | ``` 15 | 16 | ### Bower 17 | 18 | Pending. [Drop a note](https://github.com/schmich/instascan/issues/31) if you need Bower support. 19 | 20 | ### Minified 21 | 22 | Copy `instascan.min.js` from the [releases](https://github.com/schmich/instascan/releases) page and load with: 23 | 24 | ```html 25 | 26 | ``` 27 | 28 | ## Example 29 | 30 | ```html 31 | 32 | 33 | 34 | Instascan 35 | 36 | 37 | 38 | 39 | 54 | 55 | 56 | ``` 57 | 58 | ## API 59 | 60 | ### let scanner = new Instascan.Scanner(opts) 61 | 62 | Create a new scanner with options: 63 | 64 | ```javascript 65 | let opts = { 66 | // Whether to scan continuously for QR codes. If false, use scanner.scan() to manually scan. 67 | // If true, the scanner emits the "scan" event when a QR code is scanned. Default true. 68 | continuous: true, 69 | 70 | // The HTML element to use for the camera's video preview. Must be a