{"_id":"@cioplenu/cioplenu-zxing-library","_rev":"3-08d42be1daa62f0e8fa77ed383f9f990","name":"@cioplenu/cioplenu-zxing-library","dist-tags":{"latest":"0.16.0"},"versions":{"0.14.1":{"name":"@cioplenu/cioplenu-zxing-library","version":"0.14.1","description":"TypeScript port of ZXing multi-format 1D/2D barcode image processing library.","keywords":["reader","writer","decode","encode","scanner","generator","barcode","qr-code","barcode 1d","barcode 2d","typescript","zxing"],"authors":[{"name":"LD"}],"engines":{"node":">= 8.9.0"},"license":"MIT","bugs":{"url":"https://github.com/zxing-js/library/issues/new"},"repository":{"type":"git","url":"git+https://github.com/zxing-js/library.git"},"homepage":"https://zxing-js.github.io/library/","private":false,"main":"./umd/index.min.js","module":"./esm5/index.js","typings":"./esm5/index.d.ts","nyc":{"include":["src/**/*.ts"],"sourceMap":false,"instrument":false},"scripts":{"lint":"yarn tslint src/**/*.ts","clean":"yarn shx rm -rf umd esm5","test":"yarn mocha-webpack \"./src/**/*.spec.ts\" --timeout 200000 --webpack-config webpack.config.test.js","cover":"yarn nyc --reporter=lcov --reporter=text yarn test","build":"yarn clean && yarn tsc && yarn webpack --mode production","shx":"shx","tsc":"tsc","tslint":"tslint","mocha-webpack":"mocha-webpack","nyc":"nyc","webpack":"webpack-cli"},"dependencies":{"ts-custom-error":"^3.0.0","text-encoding":"^0.7.0"},"optionalDependencies":{"text-encoding":"^0.7.0"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^10.12.29","@types/seedrandom":"^2.4.27","@types/sharp":"^0.21.2","@types/text-encoding":"0.0.35","awesome-typescript-loader":"^5.2.1","chai":"^4.2.0","codacy-coverage":"^3.4.0","eslint":"^5.15.1","istanbul-instrumenter-loader":"^3.0.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.2","karma-mocha":"^1.3.0","karma-remap-coverage":"^0.1.5","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-typescript":"^3.0.13","karma-typescript-preprocessor":"^0.4.0","karma-webpack":"^3.0.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","mocha-webpack":"^2.0.0-beta.0","nyc":"^13.3.0","seedrandom":"^2.4.4","sharp":"^0.21.3","shx":"0.3.2","sinon":"^7.2.7","ts-loader":"^5.3.3","tslint":"^5.13.1","typescript":"~2.7.2","uglify-js":"^3.4.9","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^2.2.3","webpack-config-utils":"2.3.1","webpack-node-externals":"^1.6.0"},"gitHead":"2fddacaaa626b34908019ed5e2e3e736e60a2aaa","_id":"@cioplenu/cioplenu-zxing-library@0.14.1","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"lidi","email":"l.diu@cioplenu.de"},"dist":{"integrity":"sha512-Byc2a4NZfuMPpZ9EyQHBGXRhnaXAt9eesw1L/GaWmrhe+TytKpYPakMZR2brGm6Vw+102y88aUp6SIr0m/1ieA==","shasum":"8c81b3fad5d03fbfbb020aa81bfe3efc1acad001","tarball":"https://registry.npmjs.org/@cioplenu/cioplenu-zxing-library/-/cioplenu-zxing-library-0.14.1.tgz","fileCount":361,"unpackedSize":1458261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdG1E3CRA9TVsSAnZWagAAXH4P/iZGFk5OyaS7r/WG6PQY\npZFGltixrjLOLxQd6OIKA8cgpmIXi1CBtk7sOuJY7Dzxk7LbS45zXayXpWeD\nZcis18E1hmQetfsdipIyecbnhgzIxrRBO8Jn/Gp3PfBo1476PHKkl3K9s+6W\nzJg4HSi1VHlt5UJ0NcJNFClZrb+mWW0/MUfkghfyr54g0UhpRVEpyOa+vMkZ\nK/txhgePLfxzqWnS7bRRureSHXsogIvJZoP85z/Ixb7cpYkLQIV1+5GktM1x\nJE9lCI23nc4NmYWVY3XU1W9SZM4vY+84tLv4oNkzUitY92yC8YpLJzra9C+w\njh8tVB7ZTYMhh6W754AaiNaXcfin1xdlFXj7jurts/2e9VvmFrP3f1P69t0U\nqJjSUUlN2qJco29uR1rLr/lqV5/5vES++qDH7S7zcQdN6H0pZAEoI9uZB+om\nVZUf7LtHze1b0b8Et0yywF1kQURM7TWxppeHWJb2UuWrX49yb0Mr5EFS/xY9\nrdto1DGsBYeiL+mGRGkmbosYgqos799nQ9gI/DbuxHfdZSWjrW9ut5FnJZcR\nGyLhSw6Xt3QJZ3WfvW1mT3dWVb0S7tVNJRftF1drhe4tuFHcqlVRtbNAN+WP\n3DiItpMABH8V/nRZ3fxJ6dl0a6M2xn9mdBugoGjeFI/NZrWRFiXUt/qzz/Lr\nN8Kv\r\n=a8E8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGx0bbGNlXp4klB5Cx7aNIROL7P9gWLeaJJTBq9bUS8AIgRw05X98EpLiUEPLs+4Z+uPTm6Xwm4iLM5M/IJNjSuk4="}]},"maintainers":[{"name":"lidi","email":"l.diu@cioplenu.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cioplenu-zxing-library_0.14.1_1562071350402_0.3650243160868425"},"_hasShrinkwrap":false},"0.15.0":{"name":"@cioplenu/cioplenu-zxing-library","version":"0.15.0","description":"TypeScript port of ZXing multi-format 1D/2D barcode image processing library.","keywords":["reader","writer","decode","encode","scanner","generator","barcode","qr-code","barcode 1d","barcode 2d","typescript","zxing"],"authors":[{"name":"LD"}],"engines":{"node":">= 8.9.0"},"license":"MIT","bugs":{"url":"https://github.com/zxing-js/library/issues/new"},"repository":{"type":"git","url":"git+https://github.com/zxing-js/library.git"},"homepage":"https://zxing-js.github.io/library/","private":false,"main":"./umd/index.min.js","module":"./esm5/index.js","typings":"./esm5/index.d.ts","nyc":{"include":["src/**/*.ts"],"sourceMap":false,"instrument":false},"scripts":{"lint":"yarn tslint src/**/*.ts","clean":"yarn shx rm -rf umd esm5","test":"yarn mocha-webpack \"./src/**/*.spec.ts\" --timeout 200000 --webpack-config webpack.config.test.js","cover":"yarn nyc --reporter=lcov --reporter=text yarn test","build":"yarn clean && yarn tsc && yarn webpack --mode production","shx":"shx","tsc":"tsc","tslint":"tslint","mocha-webpack":"mocha-webpack","nyc":"nyc","webpack":"webpack-cli"},"dependencies":{"ts-custom-error":"^3.0.0","text-encoding":"^0.7.0"},"optionalDependencies":{"text-encoding":"^0.7.0"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^10.12.29","@types/seedrandom":"^2.4.27","@types/sharp":"^0.21.2","@types/text-encoding":"0.0.35","awesome-typescript-loader":"^5.2.1","chai":"^4.2.0","codacy-coverage":"^3.4.0","eslint":"^5.15.1","istanbul-instrumenter-loader":"^3.0.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.2","karma-mocha":"^1.3.0","karma-remap-coverage":"^0.1.5","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-typescript":"^3.0.13","karma-typescript-preprocessor":"^0.4.0","karma-webpack":"^3.0.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","mocha-webpack":"^2.0.0-beta.0","nyc":"^13.3.0","seedrandom":"^2.4.4","sharp":"^0.21.3","shx":"0.3.2","sinon":"^7.2.7","ts-loader":"^5.3.3","tslint":"^5.13.1","typescript":"~2.7.2","uglify-js":"^3.4.9","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^2.2.3","webpack-config-utils":"2.3.1","webpack-node-externals":"^1.6.0"},"gitHead":"2fddacaaa626b34908019ed5e2e3e736e60a2aaa","_id":"@cioplenu/cioplenu-zxing-library@0.15.0","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"lidi","email":"l.diu@cioplenu.de"},"dist":{"integrity":"sha512-hkFQ2zS6b2kvWC7mPe1xTaNdpIAxgYya5Nkc+qWeOQigxbHLmXHtiXHs70kR2yl7sSEEQm0wbiBgaMGeCd5jfg==","shasum":"07fc1fe89c3a71ca0591e5a379782d848c057ee6","tarball":"https://registry.npmjs.org/@cioplenu/cioplenu-zxing-library/-/cioplenu-zxing-library-0.15.0.tgz","fileCount":361,"unpackedSize":1458261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdG1mjCRA9TVsSAnZWagAAwc4P/1vXq1sxI7fNqfZdTnEi\nH878VTF1pNGxvDO/qIRCU7ir8c6hdB1QRAu0IBNWj7c7h0lZ4jJcW3dJWq6l\nCTHDEmypYyztyUlfUKz4Zo4PfLY6sNkbgh4hhWQCFBbVl0a155vBQYxj9zfk\n2HDe/0hGyQ9IIs0UQ2Uw2VHXs0eglhk0zAbfnRhuf7JQDloVGybspzmUbzrh\n+plLbLO2prDZS+M+Npca1I6Jfu5/tC27CwUnJ5oag7bTPpu7WJPNgH+pxRX2\nHnNQLHfLOKboNwEOFtWhrfL69IC4kI2Cpf9QxqW7I+Dm1QC3i5dXT0+crzD7\nzLzieiPOuQge3M1Wx1FJ3n3FXCTRlHjOP6dYQCwMKf4ioVrlR/WrPl8L744V\nEU32MjGXWceBS/jwaCeF3G8rmdKzGoRXhYiBm93trFbhTKyOhKYL94x9KjEg\n4cuHbIwLeQdkgn1gDctZIG2loQ8BwEpsunw/Q8S7ZOD6puI6Rgmp5k0K22E4\nZbDY8KYGicLAy9goGCSLqgqR9e/Q0gr9iqsdQnLJyBDBA8ASKNe0NVJ7BvEO\nIXIT64ME9iPpy56sLtKOdNGThbFKIDQkpr5k8a0QyJLBklGIsN1fAEXcLpfD\nj0LB3Z25B2mYmB8wONGFsGFINLQ2SCTuZWGK27GK5Xo5sfUr+nB4nRVPdoxF\nQLix\r\n=VbS1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUI39+Nr43tizMWhbsSvhybbe7Ssmvf6r3NrKTb2GOUAiAs/KJTArFxRdVZ/EskaUjZ3nNLq52aPK1PG4kS5CmOrg=="}]},"maintainers":[{"name":"lidi","email":"l.diu@cioplenu.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cioplenu-zxing-library_0.15.0_1562073506655_0.934391496994049"},"_hasShrinkwrap":false},"0.16.0":{"name":"@cioplenu/cioplenu-zxing-library","version":"0.16.0","description":"TypeScript port of ZXing multi-format 1D/2D barcode image processing library.","keywords":["reader","writer","decode","encode","scanner","generator","barcode","qr-code","barcode 1d","barcode 2d","typescript","zxing"],"authors":[{"name":"LD"}],"engines":{"node":">= 8.9.0"},"license":"MIT","bugs":{"url":"https://github.com/zxing-js/library/issues/new"},"repository":{"type":"git","url":"git+https://github.com/zxing-js/library.git"},"homepage":"https://zxing-js.github.io/library/","private":false,"main":"./umd/index.min.js","module":"./esm5/index.js","typings":"./esm5/index.d.ts","nyc":{"include":["src/**/*.ts"],"sourceMap":false,"instrument":false},"scripts":{"lint":"yarn tslint src/**/*.ts","clean":"yarn shx rm -rf umd esm5","test":"yarn mocha-webpack \"./src/**/*.spec.ts\" --timeout 200000 --webpack-config webpack.config.test.js","cover":"yarn nyc --reporter=lcov --reporter=text yarn test","build":"yarn clean && yarn tsc && yarn webpack --mode production","shx":"shx","tsc":"tsc","tslint":"tslint","mocha-webpack":"mocha-webpack","nyc":"nyc","webpack":"webpack-cli"},"dependencies":{"ts-custom-error":"^3.0.0","text-encoding":"^0.7.0"},"optionalDependencies":{"text-encoding":"^0.7.0"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^10.12.29","@types/seedrandom":"^2.4.27","@types/sharp":"^0.21.2","@types/text-encoding":"0.0.35","awesome-typescript-loader":"^5.2.1","chai":"^4.2.0","codacy-coverage":"^3.4.0","eslint":"^5.15.1","istanbul-instrumenter-loader":"^3.0.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.2","karma-mocha":"^1.3.0","karma-remap-coverage":"^0.1.5","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-typescript":"^3.0.13","karma-typescript-preprocessor":"^0.4.0","karma-webpack":"^3.0.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","mocha-webpack":"^2.0.0-beta.0","nyc":"^13.3.0","seedrandom":"^2.4.4","sharp":"^0.21.3","shx":"0.3.2","sinon":"^7.2.7","ts-loader":"^5.3.3","tslint":"^5.13.1","typescript":"~2.7.2","uglify-js":"^3.4.9","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^2.2.3","webpack-config-utils":"2.3.1","webpack-node-externals":"^1.6.0"},"gitHead":"2fddacaaa626b34908019ed5e2e3e736e60a2aaa","_id":"@cioplenu/cioplenu-zxing-library@0.16.0","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"lidi","email":"l.diu@cioplenu.de"},"dist":{"integrity":"sha512-6DZrzQIhQ0qtx3CUMT4FYrDHF5SDqNXMoYO98URIY2xPZj1qpU/t6YSHOPMd/Ee6R9RFleLKCNDX2t6Akw/1eg==","shasum":"30201136f8584f8fc6f7b55343438b64f1148659","tarball":"https://registry.npmjs.org/@cioplenu/cioplenu-zxing-library/-/cioplenu-zxing-library-0.16.0.tgz","fileCount":361,"unpackedSize":1458261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdG17kCRA9TVsSAnZWagAAWnkP/jbelJLWowEGPCUL9gWO\newrUt7xV3cV/MYGgWAsFpgYOMWXMXTHktInxRr5nnp/Qu6nM5XZAxfg/6293\ncCX9UbdSo1I5XGTcstxsqZykjxKDqCpO7AdNPc9cIKjPjKbB9F6As4EhQ4xl\nAEFVEKrJcqAeQ9hMNswmMY1hwqFXqlo0eeDdC3tjorz6UwotLwn8vfEcwDrj\newR/V02yzBP2Aw+jZX+frO5duJq4bHJ7+mVMEl3r1BYuLWldrtofKo1lVkZF\nZfjuDmQxC2rYDaRjJQVPhkIqVOvpkutTCvSiguKlqOkn3i83WvAYkGZVORMN\n65DCVx+uTMa3t8tc0i9M0vKmBzijENmWGdo12ChgG2/xbUzwcjD7P++Xxi8y\n2TkPSRTULe+vzb0iwu6AwE3SiNOXU5C3vrx5ww+vgOFG9ktCl5XSRw+hdy1F\nedR63BzqKGV5DXsKdFawQ/F4spUDmsDUPqmJt/lCG1yrnhd/cG2q7xMebPOy\nS2LiAEi1rQ6aBXOhBozfyYfMXFDVmGr+t9TORA+drigy4uMgHboxz0aETrRT\nmEus8Y0J+72l9K72Dg9PabTD8157celxoujP+K0MsoRd/c2TIeL4EvrHwSOH\nOXDX7jMqOWUCwliFNu7dgoFfmhOSi2NUx+qBa583TqnmB2qDWVlzBOuuYm11\npWCi\r\n=XDbc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2KGf1Pe613hASrMsIWVY/rR6Y/UkVgDWG4FL/bU6mhAiEAvWjBkE3uA5/W0pVkuzZx4YZWiqruMQbhonWphAp5rwo="}]},"maintainers":[{"name":"lidi","email":"l.diu@cioplenu.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cioplenu-zxing-library_0.16.0_1562074851632_0.3809192841296052"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-02T12:42:30.170Z","0.14.1":"2019-07-02T12:42:30.641Z","modified":"2022-04-04T23:00:17.075Z","0.15.0":"2019-07-02T13:18:26.944Z","0.16.0":"2019-07-02T13:40:51.826Z"},"maintainers":[{"name":"lidi","email":"l.diu@cioplenu.de"}],"description":"TypeScript port of ZXing multi-format 1D/2D barcode image processing library.","homepage":"https://zxing-js.github.io/library/","keywords":["reader","writer","decode","encode","scanner","generator","barcode","qr-code","barcode 1d","barcode 2d","typescript","zxing"],"repository":{"type":"git","url":"git+https://github.com/zxing-js/library.git"},"bugs":{"url":"https://github.com/zxing-js/library/issues/new"},"license":"MIT","readme":"[<img align=\"right\" src=\"https://raw.github.com/wiki/zxing/zxing/zxing-logo.png\"/>][1]\n\n# ZXing\n\n### Runs on your favorite ECMAScript ecosystem\n\n> If it doesn't, we gonna make it.\n\n## What is ZXing?\n\n> [ZXing][1] (\"zebra crossing\") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.\n\n## Supported Formats\n\n> See [Projects](https://github.com/zxing-js/library/projects) and [Milestones](https://github.com/zxing-js/library/milestones) for what is currently done and what's planned next. 👀\n\n| 1D product | 1D industrial       | 2D             |\n| ---------- | ------------------- | -------------- |\n| ~~UPC-A~~  | Code 39             | QR Code        |\n| ~~UPC-E~~  | ~~Code 93~~         | Data Matrix    |\n| EAN-8      | Code 128            | ~~Aztec~~ \\*   |\n| EAN-13     | ~~Codabar~~         | ~~PDF 417~~ \\* |\n|            | ITF                 | ~~MaxiCode~~   |\n|            | RSS-14              |\n|            | ~~RSS-Expanded~~ \\* |\n\n**\\*** In progress, may have open PR.\n\n## Status\n\n[![Build Status](https://travis-ci.org/zxing-js/library.svg?branch=master)](https://travis-ci.org/zxing-js/library)\n![Dependencies](https://david-dm.org/zxing-js/library.svg)\n[![Greenkeeper badge](https://badges.greenkeeper.io/zxing-js/library.svg)](https://greenkeeper.io/)\n\n[![NPM version](https://img.shields.io/npm/v/@zxing/library.svg?&label=npm)][0]\n[![npm](https://img.shields.io/npm/dm/localeval.svg)][0]\n[![Contributors](https://img.shields.io/github/contributors/zxing-js/library.svg)](https://github.com/zxing-js/library/graphs/contributors)\n[![Commits to deploy](https://img.shields.io/github/commits-since/zxing-js/library/master.svg?label=commits%20to%20deploy)](https://github.com/zxing-js/library/compare/master...develop)\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/39d86bc5d5f04bc8953cc68d729807b0)](https://www.codacy.com/app/zxing-js/library?utm_source=github.com&utm_medium=referral&utm_content=zxing-js/library&utm_campaign=Badge_Grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/2b9c6ae92412ee8e15a9/maintainability)](https://codeclimate.com/github/zxing-js/library/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/2b9c6ae92412ee8e15a9/test_coverage)](https://codeclimate.com/github/zxing-js/library/test_coverage)\n[![BCH compliance](https://bettercodehub.com/edge/badge/zxing-js/library?branch=master)](https://bettercodehub.com/)\n\n## Demo\n\nSee [Live Preview](https://zxing-js.github.io/library/) in browser.\n\n**Note:** All the examples are using ES6, be sure is supported in your browser or modify as needed, Chrome recommended.\n\n## Installation\n\n`npm i @zxing/library --save`\n\nor\n\n`yarn add @zxing/library`\n\n## Usage\n\n### Use on browser with ES6 modules:\n\n```html\n<script type=\"module\">\n  import { BrowserQRCodeReader } from '@zxing/library';\n\n  const codeReader = new BrowserQRCodeReader();\n  const img = document.getElementById('img');\n\n  try {\n      const result = await codeReader.decodeFromImage(img);\n  } catch (err) {\n      console.error(err);\n  }\n\n  console.log(result);\n</script>\n```\n\n#### Or asynchronously:\n\n```html\n<script type=\"module\">\n  import('@zxing/library').then({ BrowserQRCodeReader } => {\n\n    const codeReader = new BrowserQRCodeReader();\n    const img = document.getElementById('img');\n\n    try {\n        const result = await codeReader.decodeFromImage(img);\n    } catch (err) {\n        console.error(err);\n    }\n\n    console.log(result);\n\n  });\n</script>\n```\n\n### Use on browser with AMD:\n\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/requirejs\"></script>\n<script type=\"text/javascript\">\n  require(['@zxing/library'], ZXing => {\n    const codeReader = new ZXing.BrowserQRCodeReader();\n    const img = document.getElementById('img');\n\n    try {\n        const result = await codeReader.decodeFromImage(img);\n    } catch (err) {\n        console.error(err);\n    }\n\n    console.log(result);\n  });\n</script>\n```\n\n### Use on browser with UMD:\n\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/@zxing/library@latest\"></script>\n<script type=\"text/javascript\">\n  window.addEventListener('load', () => {\n    const codeReader = new ZXing.BrowserQRCodeReader();\n    const img = document.getElementById('img');\n\n    try {\n        const result = await codeReader.decodeFromImage(img);\n    } catch (err) {\n        console.error(err);\n    }\n\n    console.log(result);\n  });\n</script>\n```\n\n### Use outside the browser with CommonJS:\n\n```javascript\nconst { MultiFormatReader, BarcodeFormat } = require('@zxing/library/esm5'); // use this path since v0.5.1\n\nconst hints = new Map();\nconst formats = [BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX/*, ...*/];\n\nhints.set(DecodeHintType.POSSIBLE_FORMATS, formats);\n\nconst reader = new MultiFormatReader();\n\nreader.setHints(hints);\n\nconst luminanceSource = new RGBLuminanceSource(imgWidth, imgHeight, imgByteArray);\nconst binaryBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource));\n\nreader.decode(binaryBitmap);\n```\n\n## Browser Support\n\nThe browser layer is using the [MediaDevices](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) web API which is not supported by older browsers.\n\n_You can use external polyfills like [WebRTC adapter](https://github.com/webrtc/adapter) to increase browser compatibility._\n\nAlso, note that the library is using the [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) (`Int32Array`, `Uint8ClampedArray`, etc.) which are not available in older browsers (e.g. Android 4 default browser).\n\n_You can use [core-js](https://github.com/zloirock/core-js) to add support to these browsers._\n\n### Scanning from Video Camera\n\nTo display the input from the video camera you will need to add a video element in the HTML page:\n\n```html\n<video\n  id=\"video\"\n  width=\"300\"\n  height=\"200\"\n  style=\"border: 1px solid gray\"\n></video>\n```\n\nTo start decoding, first obtain a list of video input devices with:\n\n```javascript\nconst codeReader = new ZXing.BrowserQRCodeReader();\n\ncodeReader\n  .listVideoInputDevices()\n  .then(videoInputDevices => {\n    videoInputDevices.forEach(device =>\n      console.log(`${device.label}, ${device.deviceId}`)\n    );\n  })\n  .catch(err => console.error(err));\n```\n\nIf there is just one input device you can use the first `deviceId` and the video element id (in the example below is also 'video') to decode:\n\n```javascript\nconst firstDeviceId = videoInputDevices[0].deviceId;\n\ncodeReader\n  .decodeFromInputVideoDevice(firstDeviceId, 'video')\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\nIf there are more input devices then you will need to chose one for `codeReader.decodeFromInputVideoDevice` device id parameter.\n\nYou can also provide `undefined` for the device id parameter in which case the library will automatically choose the camera, preferring the main (environment facing) camera if more are available:\n\n```javascript\ncodeReader\n  .decodeFromInputVideoDevice(undefined, 'video')\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\n### Scanning from Video File\n\nSimilar as above you can use a video element in the HTML page:\n\n```html\n<video\n  id=\"video\"\n  width=\"300\"\n  height=\"200\"\n  style=\"border: 1px solid gray\"\n></video>\n```\n\nAnd to decode the video from an url:\n\n```javascript\nconst codeReader = new ZXing.BrowserQRCodeReader();\nconst videoSrc = 'your url to a video';\n\ncodeReader\n  .decodeFromVideo('video', videoSrc)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\nYou can also decode the video url without showing it in the page, in this case no `video` element is needed in HTML.\n\n```javascript\ncodeReader\n  .decodeFromVideoUrl(videoUrl)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n\n// or alternatively\n\ncodeReader\n  .decodeFromVideo(null, videoUrl)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\n### Scanning from Image\n\nSimilar as above you can use a img element in the HTML page (with src attribute set):\n\n```html\n<img\n  id=\"img\"\n  src=\"qrcode-image.png\"\n  width=\"200\"\n  height=\"300\"\n  style=\"border: 1px solid gray\"\n/>\n```\n\nAnd to decode the image:\n\n```javascript\nconst codeReader = new ZXing.BrowserQRCodeReader();\nconst img = document.getElementById('img');\n\ncodeReader\n  .decodeFromImage(img)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\nYou can also decode the image url without showing it in the page, in this case no `img` element is needed in HTML:\n\n```javascript\nconst imgSrc = 'url to image';\n\ncodeReader\n  .decodeFromImage(undefined, imgSrc)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\nOr decode the image url directly from an url, with an `img` element in page (notice no `src` attribute is set for `img` element):\n\n```html\n<img\n  id=\"img-to-decode\"\n  width=\"200\"\n  height=\"300\"\n  style=\"border: 1px solid gray\"\n/>\n```\n\n```javascript\nconst imgSrc = 'url to image';\nconst imgDomId = 'img-to-decode';\n\ncodeReader\n  .decodeFromImage(imgDomId, imgSrc)\n  .then(result => console.log(result.text))\n  .catch(err => console.error(err));\n```\n\n## Barcode generation\n\nTo generate a QR Code SVG image include 'zxing.qrcodewriter.min.js' from `build/vanillajs`. You will need to include an element where the SVG element will be appended:\n\n```html\n<div id=\"result\"></div>\n```\n\nAnd then:\n\n```javascript\nconst codeWriter = new ZXing.BrowserQRCodeSvgWriter();\n// you can get a SVG element.\nconst svgElement = codeWriter.write(input, 300, 300);\n// or render it directly to DOM.\ncodeWriter.writeToDom('#result', input, 300, 300);\n```\n\n## Contributing\n\nSee [Contributing Guide](https://github.com/zxing-js/library/blob/master/CONTRIBUTING.md) for information regarding porting approach and reasoning behind some of the approaches taken.\n\n## Contributors\n\nSpecial thanks to all the contributors who have contributed for this project. We heartly thankful to you all.\n\n[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/0)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/0)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/1)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/1)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/2)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/2)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/3)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/3)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/4)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/4)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/5)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/5)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/6)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/6)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/7)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/7)\n\nAnd a special thanks to @aleris who created the project itself and made the initial QR code port.\n\n---\n\n[![Bless](https://cdn.rawgit.com/LunaGao/BlessYourCodeTag/master/tags/alpaca.svg)](http://lunagao.github.io/BlessYourCodeTag/)\n\n[0]: https://www.npmjs.com/package/@zxing/library\n[1]: https://github.com/zxing/zxing\n","readmeFilename":"README.md"}