├── .editorconfig ├── .eslintrc ├── .github ├── lock.yml └── workflows │ ├── ci.yml │ └── npmpublish.yml ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── LICENSE ├── README.md ├── cypress.json ├── cypress ├── fixtures │ ├── images │ │ └── blackbox │ │ │ ├── aztec-1 │ │ │ ├── 7.png │ │ │ ├── 7.txt │ │ │ ├── lorem-151x151.png │ │ │ └── lorem-151x151.txt │ │ │ ├── aztec-2 │ │ │ ├── 01.png │ │ │ ├── 01.txt │ │ │ ├── 22.png │ │ │ └── 22.txt │ │ │ ├── code128-1 │ │ │ └── 1.png │ │ │ ├── datamatrix │ │ │ ├── 0123456789.png │ │ │ ├── 17.png │ │ │ └── abcdefg-64x64.png │ │ │ ├── ean13-1 │ │ │ └── 1.png │ │ │ ├── itf │ │ │ └── 1.png │ │ │ ├── pdf417-2 │ │ │ ├── 05.png │ │ │ └── 15.png │ │ │ ├── pdf417-3 │ │ │ └── 08.png │ │ │ └── qrcode-3 │ │ │ └── 01.png │ ├── index.html │ ├── qrcode-video.mjpeg │ └── videos │ │ └── qrcode.mp4 ├── integration │ ├── aztec-code-reader.spec.js │ ├── browser-code-reader.spec.js │ ├── datamatrix-code-reader.spec.js │ ├── multi-format-oned-reader.spec.js │ ├── multi-format-reader.spec.js │ ├── pdf417-reader.spec.js │ └── qr-code-reader.spec.js ├── plugins │ └── index.js └── support │ ├── commands.js │ └── index.js ├── package.json ├── rollup.config.js ├── src ├── common │ ├── DecodeContinuouslyCallback.ts │ ├── HTMLCanvasElementLuminanceSource.ts │ ├── HTMLVisualMediaElement.ts │ ├── IScannerControls.ts │ └── navigator-utils.ts ├── index.ts ├── readers │ ├── BrowserAztecCodeReader.ts │ ├── BrowserCodeReader.ts │ ├── BrowserDatamatrixCodeReader.ts │ ├── BrowserMultiFormatOneDReader.ts │ ├── BrowserMultiFormatReader.ts │ ├── BrowserPDF417Reader.ts │ ├── BrowserQRCodeReader.ts │ └── IBrowserCodeReaderOptions.ts └── writers │ ├── BrowserCodeSvgWriter.ts │ └── BrowserQRCodeSvgWriter.ts ├── tsconfig.json ├── tsconfig.lib-cjs.json ├── tsconfig.lib-es2015.json ├── tsconfig.lib-esm.json ├── tslint.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [{*.txt,*.json,*.xml}] 16 | insert_final_newline = false 17 | 18 | [*.yml] 19 | insert_final_newline = true 20 | indent_size = 2 21 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "module", 5 | "ecmaFeatures": { 6 | "jsx": false 7 | } 8 | }, 9 | "rules": { 10 | "semi": "error", 11 | "quotes": ["error", "single"] 12 | }, 13 | "env": { 14 | "es6": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Continuous Integration 5 | 6 | on: 7 | # Trigger the workflow on push or pull request, 8 | # but only for the main branch 9 | push: 10 | branches: 11 | - master 12 | pull_request: 13 | branches: 14 | - master 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v3 21 | - uses: actions/setup-node@v3 22 | with: 23 | node-version: 18 24 | 25 | - name: Get yarn cache directory path 26 | id: yarn-cache-dir-path 27 | run: echo "::set-output name=dir::$(yarn cache dir)" 28 | 29 | - uses: actions/cache@v1 30 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 31 | with: 32 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 33 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 34 | restore-keys: | 35 | ${{ runner.os }}-yarn- 36 | 37 | - name: Install dependencies 38 | run: yarn install --frozen-lockfile 39 | 40 | - name: Build the application 41 | run: yarn build 42 | 43 | - name: E2E Test the application 44 | run: yarn e2e:test 45 | -------------------------------------------------------------------------------- /.github/workflows/npmpublish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [published] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: actions/setup-node@v3 16 | with: 17 | node-version: 18 18 | 19 | - name: Get yarn cache directory path 20 | id: yarn-cache-dir-path 21 | run: echo "::set-output name=dir::$(yarn cache dir)" 22 | 23 | - uses: actions/cache@v1 24 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 25 | with: 26 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 27 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 28 | restore-keys: | 29 | ${{ runner.os }}-yarn- 30 | 31 | - name: Install dependencies 32 | run: yarn install --frozen-lockfile 33 | 34 | - name: Build the application 35 | run: yarn build 36 | 37 | - name: E2E Test the application 38 | run: yarn e2e:test 39 | 40 | - name: Build the package 41 | run: | 42 | npm pack dist/ 43 | mv zxing-browser-*.tgz package.tgz 44 | 45 | - name: Upload build artifacts 46 | uses: actions/upload-artifact@v1 47 | with: 48 | name: pack-artifact 49 | path: ./package.tgz 50 | 51 | publish-npm: 52 | needs: build 53 | runs-on: ubuntu-latest 54 | steps: 55 | 56 | - name: Download build artifacts 57 | uses: actions/download-artifact@v1 58 | with: 59 | name: pack-artifact 60 | 61 | - uses: actions/setup-node@v3 62 | with: 63 | node-version: 18 64 | registry-url: https://registry.npmjs.org/ 65 | 66 | - run: npm publish ./pack-artifact/package.tgz 67 | env: 68 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .awcache 2 | staging/ 3 | autotransform/input/* 4 | autotransform/output/* 5 | node_modules/ 6 | cypress/screenshots 7 | cypress/videos 8 | 9 | .DS_Store 10 | .idea 11 | .nyc_output 12 | *.log 13 | *.iml 14 | 15 | coverage 16 | typings 17 | docs 18 | dist 19 | 20 | ## this is generated by `npm pack` 21 | *.tgz 22 | package 23 | .tmp 24 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "EditorConfig.EditorConfig" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "type": "chrome", 5 | "request": "attach", 6 | "name": "Attach to Cypress Chrome", 7 | "port": 9222, 8 | "webRoot": "${workspaceFolder}", 9 | "sourceMaps": true, 10 | "skipFiles": ["cypress_runner.js"] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "tslint.enable": true, 4 | "typescript.tsdk": "node_modules\\typescript\\lib" 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "typescript", 8 | "tsconfig": "tsconfig.json", 9 | "problemMatcher": [ 10 | "$tsc" 11 | ], 12 | "group": { 13 | "kind": "build", 14 | "isDefault": true 15 | } 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 ZXing for JS 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [][1] 2 | 3 | # ZXing 4 | 5 | ## What is ZXing? 6 | 7 | > [ZXing][1] ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. 8 | 9 | ## Browser layer 10 | 11 | This is a library for enabling you to use with ease the ZXing for JS library on the browser. It includes features like scanning an `` element, as well as `