{"_id":"@preflower/barcode-detector-polyfill","_rev":"2-4dd5f2a1a3e1d977e24cf884c21b2190","name":"@preflower/barcode-detector-polyfill","dist-tags":{"latest":"0.9.21"},"versions":{"0.9.16":{"name":"@preflower/barcode-detector-polyfill","version":"0.9.16","keywords":["polyfill","barcode","qrcode","zbar","wasm","webassembly"],"author":{"name":"F. Kasper","email":"fkasper@modus-operandi.at"},"license":"MIT","_id":"@preflower/barcode-detector-polyfill@0.9.16","maintainers":[{"name":"preflower","email":"preflower.lin@gmail.com"}],"homepage":"https://github.com/undecaf/barcode-detector-polyfill#readme","bugs":{"url":"https://github.com/undecaf/barcode-detector-polyfill/issues"},"dist":{"shasum":"871244d3971052370974422c011f5edba71a7fdb","tarball":"https://registry.npmjs.org/@preflower/barcode-detector-polyfill/-/barcode-detector-polyfill-0.9.16.tgz","fileCount":9,"integrity":"sha512-B77jnOhRD8IiR7crlsy8FdqZswvJUJeU/p5mEAMZSQgsavgTRX1gkTLHlYHNUV0l1NYAFYrsIZPhxoN+FXin+g==","signatures":[{"sig":"MEUCIA0+8ilMVOlwCYtjqMvNLPzrxLiXz7FHfpkpDZLfI0xjAiEAtfxNUaqeV+LMXB25tpP50rhVZSX9Aymj2V905blNKcw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSi44ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXlBAApRcZMwP82eAraQCOKxGXDzik3tjwKQ7tu0JJVv5uIO7DDLul\r\nQKXtG7hQMKL9xQI56+i1vCoi/1bLm31nLv7agPsZeC4EmP4y1ufi2r2MUum3\r\nL4NQFopJaOx6UMqniOMQjOtNlTfLNQs3/5BdzkVBeKgENgkPPSxwoPoRvEUj\r\nh7hXZsw5Racc/c/KYHInMNaZtFqPoyAoOhb0fLtPR3l+mB0rIkMtMdLjy2/G\r\nByd78KqjfQAnwp5oXa9Mp4S2PsIbPocj16e0OM3826Fn6Tv8fVnteKd6+Ini\r\ngG29uzz4bH2PkrLKcKi1lb50g3CjmO3GDk7yrw+7sl+LsPxNrQwUKS19ZGlr\r\no+O7XcE9QflxkG7zKadaHL6Au5gNn96GFqUk3d7tObf1TzBN5X14jmQtroOM\r\nE4wUQaZJLYSUl837RrbnjBNZHdNOvVPGIwvStU8jsRyJG0H7dTp0qYkYnmh0\r\n5c3mGjXmMRQ+Xd/ntdgQpik0yNmQVgbFJEkSaFLR6XTk5E60QWUFCgUIp2TG\r\nu2F+zZMp1g7yuA+q+Q5Fc7kTIS3fZE15Uh00TZhL9wvhwWZ9tRM7Klx9XabO\r\nnJEthU7mhRUzfbYexQ78Rx+qm8e7ChR4nAhiJeDXC+oTEv4wkS57MZXBWSAN\r\nJS+WBIZ0hRQo+00bYIfdMmXymnJeXd4wXH0=\r\n=3V/g\r\n-----END PGP SIGNATURE-----\r\n"},"type":"module","_from":"file:preflower-barcode-detector-polyfill-0.9.16.tgz","types":"./dist/main.d.ts","module":"dist/main.js","exports":{".":{"script":"./dist/index.js","default":"./dist/main.js"},"./zbar-wasm":{"default":"./dist/zbar-wasm.meta.js","require":"./dist/zbar-wasm.meta.cjs"}},"scripts":{"build":"rollup --config rollup.config.js","npm:pack":"npm pack","prebuild":"rimraf dist/*","npm:audit":"npm audit --omit=dev","test:unit":"karma start ./karma.conf.cjs","test:unit:debug":"karma start --browsers Chromium --no-single-run ./karma.conf.cjs"},"typings":"./dist/main.d.ts","_npmUser":{"name":"preflower","email":"preflower.lin@gmail.com"},"_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/undecaf/barcode-detector-polyfill.git","type":"git"},"_npmVersion":"6.14.16","description":"A WebAssembly polyfill for the Barcode Detection API","directories":{},"_nodeVersion":"14.19.1","dependencies":{"@undecaf/zbar-wasm":"^0.9.12"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","karma":"^6.4.1","mocha":"^8.4.0","tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.62.0","ts-node":"^10.4.0","karma-chai":"^0.1.0","typescript":"^4.5.4","@types/chai":"^4.3.0","karma-mocha":"^2.0.1","@types/mocha":"^9.0.0","rollup-plugin-ts":"^2.0.4","@rollup/plugin-json":"^4.1.0","karma-spec-reporter":"0.0.33","rollup-plugin-terser":"^7.0.2","karma-chrome-launcher":"^3.1.0","rollup-plugin-license":"^2.6.1","@rollup/plugin-replace":"^3.0.1","@types/offscreencanvas":"^2019.6.4","karma-firefox-launcher":"^2.1.2","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"^21.0.1","karma-rollup-preprocessor":"^7.0.7","@rollup/plugin-node-resolve":"^13.1.2","karma-browserstack-launcher":"^1.6.0"},"_npmOperationalInternal":{"tmp":"tmp/barcode-detector-polyfill_0.9.16_1682583095989_0.591689333012422","host":"s3://npm-registry-packages"}},"0.9.20":{"name":"@preflower/barcode-detector-polyfill","version":"0.9.20","keywords":["polyfill","barcode","qrcode","zbar","wasm","webassembly"],"author":{"name":"F. Kasper","email":"fkasper@modus-operandi.at"},"license":"MIT","_id":"@preflower/barcode-detector-polyfill@0.9.20","maintainers":[{"name":"preflower","email":"preflower.lin@gmail.com"}],"homepage":"https://github.com/undecaf/barcode-detector-polyfill#readme","bugs":{"url":"https://github.com/undecaf/barcode-detector-polyfill/issues"},"dist":{"shasum":"cd617b5c3cefeade6cc00237241f006a4c58be21","tarball":"https://registry.npmjs.org/@preflower/barcode-detector-polyfill/-/barcode-detector-polyfill-0.9.20.tgz","fileCount":11,"integrity":"sha512-05jorEJ/ld8bABmrPlw4O9awIRtjElR6nuIOg3pT0VD8WzlzlPyQeke0fh6LxAg1YFt2Luivb2wLDXKmrJLfNA==","signatures":[{"sig":"MEUCIHZmeVArGfW4mqrc2T01VmP5FhP6nB5Bctx+mqJ/QgbgAiEAw4zG4JvV2MBa5QTgOrK0gqyD+b21qpr9ZMke0/ihE58=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121929},"type":"module","_from":"file:preflower-barcode-detector-polyfill-0.9.20.tgz","types":"./dist/main.d.ts","module":"dist/main.js","exports":{".":{"script":"./dist/index.js","default":"./dist/main.js"},"./zbar-wasm":{"default":"./dist/zbar-wasm.meta.js","require":"./dist/zbar-wasm.meta.cjs"}},"scripts":{"build":"rollup --config rollup.config.js","npm:pack":"npm pack","prebuild":"rimraf dist/*","npm:audit":"npm audit --omit=dev","test:unit":"karma start ./karma.conf.cjs","test:unit:debug":"karma start --browsers Chromium --no-single-run ./karma.conf.cjs"},"typings":"./dist/main.d.ts","_npmUser":{"name":"preflower","email":"preflower.lin@gmail.com"},"_resolved":"/private/var/folders/pd/7515v4pj5_139jrf4yhm4jzh0000gn/T/980075c08af2e96722f082e68dec0ec4/preflower-barcode-detector-polyfill-0.9.20.tgz","_integrity":"sha512-05jorEJ/ld8bABmrPlw4O9awIRtjElR6nuIOg3pT0VD8WzlzlPyQeke0fh6LxAg1YFt2Luivb2wLDXKmrJLfNA==","repository":{"url":"git+https://github.com/undecaf/barcode-detector-polyfill.git","type":"git"},"_npmVersion":"10.1.0","description":"A WebAssembly polyfill for the Barcode Detection API","directories":{},"_nodeVersion":"20.7.0","dependencies":{"@undecaf/zbar-wasm":"^0.10.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","karma":"^6.4.1","mocha":"^8.4.0","tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.62.0","ts-node":"^10.4.0","karma-chai":"^0.1.0","typescript":"^4.5.4","@types/chai":"^4.3.0","karma-mocha":"^2.0.1","@types/mocha":"^9.0.0","rollup-plugin-ts":"^2.0.4","@rollup/plugin-json":"^4.1.0","karma-spec-reporter":"0.0.33","rollup-plugin-terser":"^7.0.2","karma-chrome-launcher":"^3.1.0","rollup-plugin-license":"^2.6.1","@rollup/plugin-replace":"^3.0.1","@types/offscreencanvas":"^2019.6.4","karma-firefox-launcher":"^2.1.2","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"^21.0.1","karma-rollup-preprocessor":"^7.0.7","@rollup/plugin-node-resolve":"^13.1.2","karma-browserstack-launcher":"^1.6.0"},"_npmOperationalInternal":{"tmp":"tmp/barcode-detector-polyfill_0.9.20_1713518985477_0.4156431190640921","host":"s3://npm-registry-packages"}},"0.9.21":{"name":"@preflower/barcode-detector-polyfill","version":"0.9.21","description":"A WebAssembly polyfill for the Barcode Detection API","keywords":["polyfill","barcode","qrcode","zbar","wasm","webassembly"],"author":{"name":"F. Kasper","email":"fkasper@modus-operandi.at"},"license":"MIT","bugs":{"url":"https://github.com/undecaf/barcode-detector-polyfill/issues"},"homepage":"https://github.com/undecaf/barcode-detector-polyfill#readme","module":"dist/main.js","type":"module","exports":{".":{"script":"./dist/index.js","default":"./dist/main.js"},"./zbar-wasm":{"require":"./dist/zbar-wasm.meta.cjs","default":"./dist/zbar-wasm.meta.js"}},"types":"./dist/main.d.ts","typings":"./dist/main.d.ts","repository":{"type":"git","url":"git+https://github.com/undecaf/barcode-detector-polyfill.git"},"dependencies":{"@undecaf/zbar-wasm":"^0.11.0"},"devDependencies":{"@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.2","@rollup/plugin-replace":"^3.0.1","@types/chai":"^4.3.0","@types/mocha":"^9.0.0","@types/offscreencanvas":"^2019.6.4","chai":"^4.3.4","karma":"^6.4.1","karma-browserstack-launcher":"^1.6.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.2","karma-mocha":"^2.0.1","karma-rollup-preprocessor":"^7.0.7","karma-sourcemap-loader":"^0.3.8","karma-spec-reporter":"0.0.33","mocha":"^8.4.0","rimraf":"^3.0.2","rollup":"^2.62.0","rollup-plugin-license":"^2.6.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-ts":"^2.0.4","ts-node":"^10.4.0","tslib":"^2.3.1","typescript":"^4.5.4"},"scripts":{"prebuild":"rimraf dist/*","build":"rollup --config rollup.config.js","test:unit":"karma start ./karma.conf.cjs","test:unit:debug":"karma start --browsers Chromium --no-single-run ./karma.conf.cjs","npm:audit":"npm audit --omit=dev","npm:pack":"npm pack"},"_id":"@preflower/barcode-detector-polyfill@0.9.21","_integrity":"sha512-vjYTyQLGohm9McxWMLbRSb53LXs6IzcBh+ag5BdIaxs57P9hsy40ltuuCyWi2Sm/MUAC37sCloAzEvjrqt7YnA==","_resolved":"/private/var/folders/pd/7515v4pj5_139jrf4yhm4jzh0000gn/T/8807e9f9a6a22dc3a1b471674d11e9f2/preflower-barcode-detector-polyfill-0.9.21.tgz","_from":"file:preflower-barcode-detector-polyfill-0.9.21.tgz","_nodeVersion":"20.7.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-vjYTyQLGohm9McxWMLbRSb53LXs6IzcBh+ag5BdIaxs57P9hsy40ltuuCyWi2Sm/MUAC37sCloAzEvjrqt7YnA==","shasum":"cde130336a27542f7be6d5697a30f36eaa5a9f99","tarball":"https://registry.npmjs.org/@preflower/barcode-detector-polyfill/-/barcode-detector-polyfill-0.9.21.tgz","fileCount":11,"unpackedSize":123563,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICa/xGc+W1PxeS7+Ap/YIjr/HsdGB8vxZHV4UNKCyd6zAiAJwI22+I6mzLAkkMQI6GJ/QVDNs0oi6Yvi6eHxyebBAg=="}]},"_npmUser":{"name":"preflower","email":"preflower.lin@gmail.com"},"directories":{},"maintainers":[{"name":"preflower","email":"preflower.lin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/barcode-detector-polyfill_0.9.21_1732853270533_0.36490428227472216"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-27T08:11:35.928Z","modified":"2024-11-29T04:07:50.940Z","0.9.16":"2023-04-27T08:11:36.204Z","0.9.20":"2024-04-19T09:29:45.627Z","0.9.21":"2024-11-29T04:07:50.785Z"},"bugs":{"url":"https://github.com/undecaf/barcode-detector-polyfill/issues"},"author":{"name":"F. Kasper","email":"fkasper@modus-operandi.at"},"license":"MIT","homepage":"https://github.com/undecaf/barcode-detector-polyfill#readme","keywords":["polyfill","barcode","qrcode","zbar","wasm","webassembly"],"repository":{"type":"git","url":"git+https://github.com/undecaf/barcode-detector-polyfill.git"},"description":"A WebAssembly polyfill for the Barcode Detection API","maintainers":[{"name":"preflower","email":"preflower.lin@gmail.com"}],"readme":"# A WebAssembly polyfill for the Barcode Detection API\n\n![Minified size](https://badgen.net/packagephobia/install/@undecaf/barcode-detector-polyfill?color=42cc24)\n![Open issues](https://badgen.net/github/open-issues/undecaf/barcode-detector-polyfill)\n![Vulnerabilities](https://snyk.io/test/npm/@undecaf/barcode-detector-polyfill/badge.svg)\n![Total downloads](https://badgen.net/npm/dt/@undecaf/barcode-detector-polyfill)\n[![](https://badgen.net/jsdelivr/hits/npm/@undecaf/barcode-detector-polyfill)](https://www.jsdelivr.com/package/npm/@undecaf/barcode-detector-polyfill)\n![License](https://badgen.net/github/license/undecaf/barcode-detector-polyfill)\n\n> fork from @undecaf/barcode-detector-polyfill, but use dependency import @undecaf/zbar-wasm instead of dynmiac import\n\nThis package polyfills the [Barcode Detection API](https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API) for browsers,\nusing a [WebAssembly build](https://github.com/undecaf/zbar-wasm#readme) of the \n[ZBar Bar Code Reader](https://github.com/mchehab/zbar#readme) that is written in C/C++.\nIt offers the following features:\n\n+ Polyfills the [BarcodeDetector](https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector) class\n+ Supports these barcode formats: `codabar`, `code_39`, `code_93`, `code_128`, `databar`, `databar_exp`, `ean_2`, `ean_5`, \n  `ean_8`, `ean_13`, `ean_13+2`, `ean_13+5`, `isbn_10`, `isbn_13`, `isbn_13+2`, `isbn_13+5`, `itf`,\n  `qr_code`, `sq_code`, `upc_a`, `upc_e`\n+ Not supported: `aztec`, `data_matrix`, `pdf417`\n+ Scans `<img>`, `<canvas>` and live `<video>` elements, image and video `Blob`s and `File`s and more\n+ Detects multiple barcodes per frame, also with different types\n+ Barcodes may be oriented horizontally or vertically\n+ Outperforms pure JavaScript polyfills\n\nAn online example is available [on GitHub](https://undecaf.github.io/barcode-detector-polyfill/example-loaded/)\n([source code](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example-loaded) with build scripts for Rollup and esbuild)\nand [on CodePen](https://codepen.io/undecaf/pen/LYzXXzg).\n\n\n## Polyfilling `BarcodeDetector`\n\n### In an ES module\n\nInstall:\n\n```shell\n$ npm install @undecaf/barcode-detector-polyfill\n    or\n$ yarn add @undecaf/barcode-detector-polyfill\n```\n\nMake the polyfill available if necessary:\n\n```javascript\nimport { BarcodeDetectorPolyfill } from '@undecaf/barcode-detector-polyfill'\n\ntry {\n    window['BarcodeDetector'].getSupportedFormats()\n} catch {\n    window['BarcodeDetector'] = BarcodeDetectorPolyfill\n}\n    ⁝\n```\n\n\n### In a `<script type=\"module\">`\n\nImport the `BarcodeDetectorPolyfill` API:\n\n```html\n<script type=\"module\">\n    import { BarcodeDetectorPolyfill } from \"https://cdn.jsdelivr.net/npm/@undecaf/barcode-detector-polyfill@0.9.21/dist/main.js\";\n\n    try {\n        window['BarcodeDetector'].getSupportedFormats()\n    } catch {\n        window['BarcodeDetector'] = BarcodeDetectorPolyfill\n    }\n      ⁝\n</script>\n```\n\nA detailed example is available [here](https://undecaf.github.io/barcode-detector-polyfill/example-module/index.html).\n\n\n### In a plain `<script>`\n\nExpose the `BarcodeDetectorPolyfill` API in variable `barcodeDetectorPolyfill`:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/index.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/@undecaf/barcode-detector-polyfill@0.9.21/dist/index.js\"></script>\n<script>\n    try {\n        window['BarcodeDetector'].getSupportedFormats()\n    } catch {\n        window['BarcodeDetector'] = barcodeDetectorPolyfill.BarcodeDetectorPolyfill\n    }\n      ⁝\n</script>\n```\n\nA detailed example is available [here](https://undecaf.github.io/barcode-detector-polyfill/example-script/index.html).\n\n\n## Using `BarcodeDetector`/`BarcodeDetectorPolyfill`\n\n### Querying the supported barcode formats\n\n```javascript\nconst formats = await BarcodeDetector.getSupportedFormats()\n```\n\n\n### Setting up a `BarcodeDetector` instance\n\n```javascript\nconst detector = new BarcodeDetector({ formats: ['code_39', 'code_128', 'ean_13'] })\n```\n\nIf `formats` is omitted then all supported formats will be detected.\n\n<a name=\"encoding\"></a>\nWhere applicable (e.g. format `'qr_code'`), text is assumed to be UTF-8 encoded. As an extension to the\n`BarcodeDetector` API, a different encoding can be set for the `BarcodeDetectorPolyfill`:\n\n```javascript\nconst detector = new BarcodeDetectorPolyfill({ \n  formats: ['qr_code'],\n  zbar: {\n      encoding: 'iso-8859-15'\n  }\n})\n```\n\n`encoding` may be any of the [Encoding API encodings](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings).\n\n\n### Detecting barcodes\n\n```javascript\nconst barcodes = await detector.detect(source)\n```\n\n`source` must be an object of which an [`ImageBitmap`](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap)\ncan be obtained, or else a \n[`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)\nwill be thrown:\n\n+ an `<img>` element ([`HTMLImageElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement))\n+ a `<video>` element ([`HTMLVideoElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement))\n  from which a single frame will be taken\n+ a `<canvas>` element ([`HTMLCanvasElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement))\n+ an [`ImageBitmap`](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap)\n+ an [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) instance\n+ a [`CanvasRenderingContext2D`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)\n+ a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) or a \n  [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) with a content `type` of `image/*`\n\nIn addition, any object with a zero `width` or `height` property will be tolerated.\n\nThe detector processes the `source` in natural size, making detection results independent of the size rendered\nby the browser.\n\nDetected barcodes are stored as an array of objects in `barcodes` since `source` may contain multiple barcodes.\nEach object has the following properties\n([see here for details](https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector/detect#return_value)):\n\n+ `format`: the detected barcode format (one of the formats specified as constructor options)\n+ `rawValue`: the decoded barcode, always a `string` decoded from raw data [as specified](#encoding)\n+ `boundingBox`: the [`DOMRectReadOnly`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly) enclosing the\n  barcode in the `source`\n+ `cornerPoints`: an arry of four `{x, y}` pairs in clockwise order, representing four corner points of the detected barcode.\n   `BarcodeDetectorPolyfill` returns the `boundingBox` corner points.\n\nAdditional properties provided only by `BarcodeDetectorPolyfill`:\n+ `orientation`: `0`&nbsp;&rarr; image is upright, `1`&nbsp;&rarr; rotated 90° clockwise, `2`&nbsp;&rarr; upside down,\n  `3`&nbsp;&rarr; rotated 90° counterclockwise, `-1`&nbsp;&rarr; unknown\n+ `quality`: a positive integer indicating the barcode quality as seen by the detector,\n  specific to each `format`\n\nIf an error occurs during barcode detection then the `detect()` method returns a rejected\n[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\ncontaining the error.\n\n\n### Typescript support\n\nType definitions for `BarcodeDetectorPolyfill`, for constructor and method parameter types and for result types\nare provided in `@undecaf/barcode-detector-polyfill/dist/main.d.ts`. \n\n\n## Build configurations\n\n### Bundling dependency `@undecaf/zbar-wasm`\n\n[This package](https://www.npmjs.com/package/@undecaf/barcode-detector-polyfill)\nis under the MIT license although it depends on [`@undecaf/zbar-wasm`](https://www.npmjs.com/package/@undecaf/zbar-wasm)\nwhich is under LGPL.\nNevertheless, `@undecaf/zbar-wasm` may be bundled in your project as this does not violate the [LGPL requirements](https://fossa.com/blog/open-source-software-licenses-101-lgpl-license/). \n\nModule `@undecaf/zbar-wasm`, however, expects the WASM file `zbar.wasm` to be located at the same path as itself;\ndetails can be found in the [documentation of `@undecaf/zbar-wasm`](https://github.com/undecaf/zbar-wasm#bundlingdeploying-zbar-wasm).\nTherefore, bundlers must be configured accordingly. Configuration examples for [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/)\ncan be found in directory [`example-bundled`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example-bundled).\nThey were used to bundle the JavaScript code for this [online example](https://undecaf.github.io/barcode-detector-polyfill/example-bundled/)\nin [`docs/example-bundled`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/docs/example-bundled).\n\n### Loading dependency `@undecaf/zbar-wasm` at runtime\n\n~~In order to comply with the LGPL, `@undecaf/zbar-wasm` must not be bundled but may only be loaded as a library at runtime.~~\n`@undecaf/zbar-wasm` can also be loaded at runtime, by default from `https://cdn.jsdelivr.net`. It can also be fetched from\na different endpoint if desired.\n\nBundlers must be configured so that they treat `@undecaf/zbar-wasm` as an external dependency instead of trying to resolve it.\nConfiguration examples for [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/)\ncan be found in directory [`example-loaded`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example-loaded).\nThey were used to bundle the JavaScript code for this [online example](https://undecaf.github.io/barcode-detector-polyfill/example-loaded/)\nin [`docs/example-loaded`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/docs/example-loaded).\nThey also illustrate how to load `@undecaf/zbar-wasm` from a non-default endpoint.\n\n\n## Credits to ...\n\n+ [lekoala](https://github.com/lekoala) for his [`barcode-detector-zbar`](https://github.com/lekoala/barcode-detector-zbar)\n  that has an extensive list of useful links\n+ the makers of [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/) for their bundlers\n  which I consider a pleasure to work with\n\n\n## Disclaimer\n\nI, the author of this document, have compiled it to the best of my knowledge, but it still expresses my personal opinion.\nTherefore, in addition to what the licenses mentioned below state, I hereby decline any liability for\nany false, inaccurate, inappropriate or incomplete information that may be presented here.\n\n\n## License\n\nSoftware: [MIT](http://opensource.org/licenses/MIT)\n\nDocumentation: [CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)\n","readmeFilename":"README.md"}