{"_id":"dynamsoft-javascript-barcode","_rev":"121-14ef2d36836e1f74f06698a2f7346960","name":"dynamsoft-javascript-barcode","dist-tags":{"iv":"9.6.40-iv-202404120107","latest":"9.6.42","beta":"9.6.42-beta-202406210208"},"versions":{"6.4.1":{"name":"dynamsoft-javascript-barcode","version":"6.4.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.4.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/webassembly/issues"},"dist":{"shasum":"d7ee0adce1dd18894ea37b3f34ddb4411c19373e","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.4.1.tgz","fileCount":5,"integrity":"sha512-KtNlA0GVyayhHp9C4N+gJOnOdUZCk7520ISofJq7aB5T7fNb0KUeAF37c+f6ZrjotupP9xl2EfU+BpFxoqXhGQ==","signatures":[{"sig":"MEYCIQDmBorH8mhrSEutKrJbFsrwZ+wmNMB7WDBr5i5nzu93EQIhAPqvUyv9acvE0yc4YE13pT9P7/MU1o479+NXbm48EcyR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6583126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGyjVCRA9TVsSAnZWagAAis8QAJHGWK5FygQmo68Z/0qV\nDdaAsszkKxmYUCFYc9UkWLniZDTL6Z/eXDEHetUQzEed7qXylblLu306uVhe\nY3B1FsFqMKkRQ8AkcWOyv7IVYavaS3p3trsQ1uQbzikk16G8NnnARcPmRUCH\noISUGd7POV1pFS5GlJBHLguPZDiZbPJ9SkeGQ/94UqSuXnI1v6cUk0VQdY7Q\ncmqpiI9F9m8v1B710XoZjk6YSR1C3Om3Sj8oHwSVvBMbNaN/vrw23Q+CcdaF\nR5v9JFBGziUQHXeHYqP6hRE2H+vkv63jBjrkqo71Gpf3R7iK3s4EAYF+EGfY\ngcJi0/+kn998Nr7cpA8RR7bMHWfyZPv3l2JXyp7cGih59o90tpKCaVOweHVb\n0Yqp6vo8TS0P2LEiaTXPkb7XMxscvLLpHx0pu99cRR4jJ1wdZ9mGw/Qjb8PF\nrdR4JKtA6N8JLag99tyUHiO8p5d3BNUnRfzB6dBa4GXiz9v7qEmDdzbgkK3B\njSkfuMYQ3b3GmWDA4h+tESFpCMD2mE/IQcsy8ct5XQzkTcQkMZzheTs4myCG\nIQsPdA06+PyLZArpVfOolwSG7K9NVH5qy3Ya6my+3CcTC+mYMs86IY2Pui1/\nYQkhLsB6NKVoHIVAN/0u2bkkJNXmzBuinAQcLsA/I5FUJe7ocB7MaDMPr3w0\nJVpB\r\n=oO3W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","gitHead":"582e6dabaa0720cbd1739cee87894ef608d3a463","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/webassembly.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.4.1_1545283796511_0.9489303530730444","host":"s3://npm-registry-packages"}},"6.4.2":{"name":"dynamsoft-javascript-barcode","version":"6.4.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.4.2","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/webassembly/issues"},"dist":{"shasum":"ee28158f06f691e3c3ce583d2d25994f8da660c8","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.4.2.tgz","fileCount":5,"integrity":"sha512-ha4M96w9D6DVnQ385JFa5gW87l9wzxg95g4QpLNh/12QRDWbcZEVOq6//9HoYMYiYE+JYS2MJwEnLK+VO5QPFQ==","signatures":[{"sig":"MEUCIDNymCiVlDfAWdeswNzADQ4Rz5g/p6SUyqGZe32SSS00AiEA74fTyskvfA/hR2AlkA3+9UFiXER4sgGK+mNONe0sxdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6583682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGy10CRA9TVsSAnZWagAAH3kQAJDvT12gVB7bx81C9kbo\naEv8yykjT8XMKHPI3Gg461XrLZmXXxK83Anxpgd71fJNqPHkMTzv5IGGDoPd\nzuUjF3gsYoRt3QpKLHSqLUBTWI5ErLBZ4Y0II4XO1SD4DyOAb2xLxzrIR7Iz\nHzBLPzf+ll1/W4GwoQ1cNtZL1AMiRJmZV1PeL33IoREsCc+zIcndhvg13iW8\ngy4Y2GaoNDYZEHjXIETLE1S50mOi6eJ8Tl3UoYpGnIH2FqjHTdBf/JNs9AWl\n0mdOu3c+XZTOyRos11VGKfpyafHdqnmw7jax9O1j0ExpKuUMzuvlIWwaBKHZ\nmrVSXOcx/xV969moa8Tb6AgNj93lNIJeW+uNoh2d4L8/sRaA6ZhmD2LGGqSg\ngdZGr7rnTwHEJS+dORRKxs4qtWxohqD9f1WgrKu/2UkLFpxDtjP08GMCZB5k\ncf62uMIVMv24vZoRxqlaRI8CtCJsOeDqRC6s4hgcfqdVN/fVwZhKBEapqvsz\nCfyMEritHGHAZiJCnjRU1B6AmiafOMThxuqKCOpZduOO2bjsUE+MvDWJproS\n1RDZ3AXOSqrriCwh+wD50qBnczuUFyLGvTIoto5ZeGgf5WWqu6PHKw61ds50\nDRET+vOIZ6EEvlQ874yZzN+3e3u5HeG0m3cu4rb2gxpGB8Dq9XDRViZWRdkm\nZhi0\r\n=P+zq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","gitHead":"8933057a94331ffe725126249a3d4e01e9c8ff4f","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/webassembly.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.4.2_1545284979942_0.850556844082113","host":"s3://npm-registry-packages"}},"6.5.1":{"name":"dynamsoft-javascript-barcode","version":"6.5.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.5.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"22fca24b6b3caf23f9ead13bb59bc29602fb63d4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.5.1.tgz","fileCount":27,"integrity":"sha512-tFwNHiaD6rD1nR/V57iksiNIufhRK+4VSP1qAxyE1ncydpLxjIBCz/M5DmiTia+3nPT91+fbIbclsQNhRVTLaw==","signatures":[{"sig":"MEQCIHtSOzPhgY8puWYa3LNsV/l08iUxSJvenri14nDpMidoAiAjKWmx46ZS9a/O9xB+mvnVkvo6fHFou0c5vRfHDmRDkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6322835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcuZODCRA9TVsSAnZWagAAXpEQAI+YV9IygprCInVeTLSz\nVL1j5aPHlpaUbEQTq6Aw0ok9EYjQl5WWAd1Kat9vpIZNJCUDoCm3EV4XJ8u4\nMUa0ndmT5VnRFXf8/XfrtBZVKYFp57M4pQr49MQ6elhoAtyHKbgPz5zFXDd9\n3xIizRgfnXisYBYT9ZzAT/7xval9F/0EMoWqyYShgE1JoCSqst7vm0ygEz+J\nRcL6xqjWTuhsJCUSqA6kOZx9rBnq27ka9S+yWt3+DmbrX8Q1dGT+ZfVEPzuN\niRDAtm4p9zeczzG69cqkHMO1WimL7Z2UH9j/FjmJjbsQaWa3gzmMLAldd9vi\nq+Bo6/2INiCSUk6Xh03bUq4QvUzKLl0bvCaUvWH1G7Mldiv7GPSvmO48vlFW\n6hipvcDWtaYjtZQQ4SSBDCwCs9aR26CRqpYrVO3zGXAJfnwyFk4vf2tOXnGs\n3DVIzjyPMtFnr70BrEYnIbp+mKUxueAOiEFvweqIe3Yju7xd7NTgup2abcRt\n62mtX/nbooFjhAeWS3j2IOJGAXmyxlMlyd62t8qZtVPzsWj4o7ttN6EkBLc4\nwJIOok7HKjpSDqEZx8QLZrhx9niYZpSZRgUfePAUSXbOeQoHFfw/uY/N07U1\nBUtMdn4aAOM0ZNEOsW7S5Q8ZAAbQ2dPANRonBwbckpRYmcPyGgCPWJ0C5U0E\nVV2k\r\n=7vkR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"511435e063f9c20493a3fe677d1a13214da34570","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.5.1_1555665794234_0.9431646226456387","host":"s3://npm-registry-packages"}},"6.5.2":{"name":"dynamsoft-javascript-barcode","version":"6.5.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.5.2","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"f10843a2339eb0fb8a6c1c09f85508ef14241052","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.5.2.tgz","fileCount":57,"integrity":"sha512-vdKQyXOIdhPivcMwrzLQ0spzL7Bm2N7M8fWFET3I2lza2t8h2NRu5ZEH9/xq1//ppBwcYTEZWHz2CuuC9tIgNQ==","signatures":[{"sig":"MEUCIHqbJZnZt/0zT1YNouj9sRdoS5BpWtQ8fyQ9DWG44S95AiEAvpNsklLMNUm4MRAPLCYQo1HfFZYSGEARNS2e+g8nMdI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7071507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxRtUCRA9TVsSAnZWagAAtCUP/0dcUsmLn+2oHeTnnRbi\n5fGPhsp+r1DruwzWA+rmoTDVPeab1GkOYdVCGeaYSPQnOCoIt9d9RIhqSUFd\nwuuHi81KSh49WRiZNToIv39K+DLXGIPkCuv6VFLCFkBESTGfnP2Tqat1T0fc\nwtcR5yuldi+FiyptYPMcVkK4NS2B+/+u3b2CfZlVsSBq1e5TqEDkpE4rLMb2\nV6V8OVlj4cbTrZYJgzxfl1PVEgp6b0JZnQqOCXE9vnpiPDQ4B9obQyVGpjq7\ncunO5X+yCdL5u98ZAXajU+G7o+nbK+PxeN1+JGFYj6WaMubi9DpKpqelQ72K\n0S/q55IudgQuNAVbQEaNZ6UgzyiUezMfuNdTV/4Wk67h4Qrj+44LL4+r8pj0\nAyuJ5cBkMF0/STkV9elorbKN+BrI/l6aP6RqDfeR2pVn17vfc1o6Kkyb/xMw\nmpT7jmwGbZ9rMCL0CcSUqzoY2iyoHc9ZV+O1fJX4acyR9Ku9t/ragb53cPOW\nQLdxuxNpnPg53eJ73eKiAu2mqgX7JNFRNr4HHsDD4RrJLpobJ0I1OazAqLIZ\nyqjNYfjWxK0gGjzbn7OXbE2/ur+XfZquOQqaephIyKTLKKLl5ARKagYfht8Z\noiw/rHxslTd5OuWgOtZmg2g53f36145+eKRMLFjPAF/QzyKTvhaIInkXco+z\nsLI9\r\n=irSM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"d361c61b01578b7cfad254b39625959227e6190a","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.5.2_1556421459579_0.6024219315930797","host":"s3://npm-registry-packages"}},"6.5.3":{"name":"dynamsoft-javascript-barcode","version":"6.5.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.5.3","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"fa01c7401e50992762bf02451785757e38c178b3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.5.3.tgz","fileCount":57,"integrity":"sha512-1y9vOMqzvO26KuQIDaqGNqz3mOUuzimPM0WQNQhYk/eRRrljGildQqTpF5jx1vV3ct+NJ8dwqOYLY82rjJRWlA==","signatures":[{"sig":"MEUCIQDUjpJCceUa6E/mgo/I1RRbFWjE+WMv+z65p0gUmWjq8wIgOWP/UN6mAom9wJv8pKwtBQ4ieItbFQ02RMfbJm1AA8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7071479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxlUlCRA9TVsSAnZWagAAbHYP/3QRMouZRoAzGAmJZdJr\nGSkUINtUnwJl8CkwUxZ1WaSC+/osGUFjpH5cNAPfyqrY0KMH/r1XdxsCDYMi\n+fqXe97CrsNM/mNiGR+/0roQ3AtH+L+is+eMZ93he92tbB6E1kdzto05B5hF\nGXfUJIafEThr2yv30DRrq7dW5nt/0IXeWvxDYCKWpF4p4y2khi/cpMD+UZT9\nyaL/olhDaFVGGikfGgL/4dyxuBZsQJKRfLZ/xZWeBD+/pkHuFP4Ty55blzBM\nyqgAWNyAebqYSfwBcaIVcSPUAZmcMR7ae0Ad42XeakNyTKVSI4ovdUE89SZY\n0wdyXmkhYgIHHTwVMEwXl7l3G3rsPDbhv+y7/YD3Fc58YsymPwBZ4qY6q50B\nnq+7OHatZDu0KqUGJtd4ZQn+yoW1Zuz086xG4Gnux+wiVdQmnkRIrku2h1bK\nxWjK8rs1vUIyRYUhQk7lStouUFK+9+xeU4vxbcNFgvdIpZSZsLGa3GWpzYV7\nH5UGNX7MoSSOlEVwmn5LRWFHINKKcxCXpRE8tRPfQK2dQzwo9DS4zBrQsuOA\nfkCPYATT3wIOvIwTDMPwB61o7q02cPxFxjzkXW4WIixu0wZDsM+qhlf6NsvD\nG1kscAMYbBf+fpawACXlULRSgAUPaYj355XUTqdN/Wrex11Xy4hc42mQqhKS\ndY5E\r\n=uu/1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"c2b5304a05b92c60ee5b21f59aa477ab6baa45cd","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.5.3_1556501796653_0.54216104015906","host":"s3://npm-registry-packages"}},"6.5.4":{"name":"dynamsoft-javascript-barcode","version":"6.5.4","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@6.5.4","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"e80238ba0ff80d81457078c24eeac8417ac2b3a2","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-6.5.4.tgz","fileCount":107,"integrity":"sha512-/vNQYXglsrckzlMPEPrhqdu0zjElGuNymj0xXpfJrn51KsprPtwFbos2HF5OVk8OaYSZLdvFU/0U/BmiAux3lA==","signatures":[{"sig":"MEYCIQD78dj9vl9mnGQKFJk9VpUIeiRbgHNQHd7utAuYpZAPTgIhAPa0keHwTV81PZm//XP3HyICAAgZyjzcPbhOVCG38TRh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7293487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAvBACRA9TVsSAnZWagAA9+oP/RiSHn7VXUNtNp68wqnZ\n4/PxTJ8e/Ps3SHlmfgu9fUjUzrBJgk/mSzgr7QNBs/Lwq7S9C7RewfZPjxec\ntRrPbglMinNvjmSVyDKmX0Mg3MY0ysBCT3bQNfpsYwiB3Gm8mblPIwIZ+FuT\nqEIjycxVSim4x4sOh7LwswxjnIQRi2nGbpsYPS2Nvn+qWuMo8WtEYuSlwrKE\n4UVZPbPeVN8OjbRDNsTL7RssL1bdXfigHDy4cgzHB1vnkAFxrZrfBIbwZIUN\n347DHvU91BYqU3wCAgwMAsg1ZOR8Rx2uYj8CiwsavtB51/GpHBktpF+5iM3U\n96vbz+yKEeM/Dkw21t9Nfkn/71EYPykI/SEzzoNyfzcJ9dbuXaxrS7LLagla\n3XH8Skl19sNq67Z2B3bfE3Old9gKuPi+KAdFcztHhg4T/0UAm+lR5IepWvP5\ncZ9i1o8PYDbXT8B+MyxgwrLHDPU+vvS46Teh7GRJy4l+67mwqArSPi63yUk+\nhwMO3865yrEkavCcwlUVKh2eUC90ibOaSpdMOhWQk3FzOJq7Nr13c+/E1AdM\nomBGevxtBr0aZI3C+eBytOjBDECJWclvrCU4zhVIFKyAh8+43PGK3JzuLw6S\nrcEMxHt82ui0geQx4vDPOzwqoJ1QI22jKCHm2dS1qFN5FZYx2n14lF+KkPtT\nrz8z\r\n=1Y69\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"c9df25175fd8e50aa42f9aee4d104df490db8c92","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.3","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_6.5.4_1560473663356_0.08165336606435503","host":"s3://npm-registry-packages"}},"7.0.0":{"name":"dynamsoft-javascript-barcode","version":"7.0.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.0.0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"29f5f755252dd1ddd4a67a1d29cfdb51018abfa4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.0.0.tgz","fileCount":110,"integrity":"sha512-0VszQeFESd/jElyAkMDunZQVHJRJMNTBFBhY+1IMxk4wkBUaM5N4savEScWpGpJc9lzZg2QFoDWtzIEgHQR7Lg==","signatures":[{"sig":"MEQCIBkkm4zqpVbO6eeU+Y8gdy4+jURJp0YW4zVT/ipaKTu3AiAxe0/fUNBb799RptepE8K/+CQgcQ3MFuHA256mdm+vFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8384937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdTSbdCRA9TVsSAnZWagAAj3wP/0BdD8V33k8y/m9t5XLo\n/V/KfmKQylf15nWzWcVnuRc49oRQDRWbB2tc42jUKAdz8TNd5REMrfg58KTA\nFi/H4w7xfUgLinsoN48EFLIz8ovwIQwKB7sfjvfoK4v4UNTZ9Wn9UDf3HRqG\n94cUZyeCCcjZujAzuMajHrElr8NfbCH94RfUPV9fWjWxOAhXE6jOrH6Tnli/\nXXUrS6ami41+hjuEGdCYDN0qxrY7YTJumfS1++jrC6JNGvv2FytGw9WcO816\nEQEkigBqYCba22EwJl4Q/BmofQrgJ7b6HunOScWLF0CACxKx91bh4ng2czUx\nbr8N4rXa5WciBFrLCWMwDlGb+HGSdPRUba5KTGNhK0gmo+x400jPgbeMyBP4\nwsJCNH24aGempVmFOpkmLTNBqkkS/BFDRRpG/OFoBsePC09cAI2p9/LdbOBj\nLLgOP6ygZCigY/kYPeaIOxfMGnnTnKTxHv876EodmFnxeMruP2l1Wbl/cheT\nm0zEgBoS646+JjHb5YjrBUJdPr+l2pbEXUxDWE7Q3aINirhCQaM3kik0pFhn\nhff0lXpXpZJoC/4/+GE05UEj4FA67biwVFo6Gc1cpuKf804RDj8tOs7n/0Q1\nzOTx+1VYHjjr4FHrPy3NAMX033VOIFLsu5VJV3CrUFddotAl7q57zZK5o0MM\not0Q\r\n=ijwn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"a5b8eec4b533d2a52b14d6bc40f92feb4d6c6e59","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.0.0_1565337308835_0.7470926375597382","host":"s3://npm-registry-packages"}},"7.1.0-beta.1":{"name":"dynamsoft-javascript-barcode","version":"7.1.0-beta.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.1.0-beta.1","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"557871babcd1f4b8ec686fc78686de3ce90205e2","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.1.0-beta.1.tgz","fileCount":119,"integrity":"sha512-BGM/LiQgFa2nMXMREiAxOq4n9AW8Zgz+aZr6+SzrTegOdlfxfLj3lSlvkFs6GFVvJaTv01i3Cv8WY7qve+tIDA==","signatures":[{"sig":"MEYCIQDj1xLhZEthNAQadPNZqm8mpdtyRgxYHWrIUCpHQITk8AIhAOigvEEc+hokM3XC8UI9kz4WktNjwMUoHzShqhexHRLS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14079673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZPAOCRA9TVsSAnZWagAArtoP+wQHuTi6K9ceXbV6MwZB\nkvQDqpJ/bWNfDxY4M7istTeLbi/TYd5F+l/btiCT+okz4p1T89LO/UlbYfuY\nhwJa+EO/aY02XVsy1rvm8hvPU85mpKrN643CRJ4LGGjTYyUAO94C1TmNQ/Kk\n/WBuVeg75l7lEC925MBnvbI/GolG8Ep7mXIiNYPmMPSZY2fSMoXwt+5dQokP\n5gUYPwALE1B/5hqDdVJ7raXnQzP+CiYPls1qGbhlZIZ8MHyKtOYSMy3ctf95\nLMMED+4usnr/EvBSoSknQF8cmxy85DXDdDhS2RY3AOChZB07XEaOZOaY8Kde\nHIGgd5gmcBjxL7Lc4kmJlk6xpb2ajCpswR2ySYcLk7RhvJxr+zEUNlJD9RAv\nhBKbwXNYKVD7oOAJZsm+IXJIyob56PqHG8IVev6KnGtxvLS/msIR/lXEcWKI\nAi8DdG8cXPou+D5e0PD2zTjUkrgktaorAxswCfG8yu1kUJL9TFFoIhnu68Gr\nQ7ReOh5qTMwvZxIR9ucd4uQ8Z5M1TrfxTBXxSRgMMduttGS7opma3W6f/a0X\nMTxUfmvjhjP4ddwHvu90t3pJNJDQHPPfChSndWaPTUAepkJBmj7TgHjd56Ii\nKLSRIPgz6JGYVPx4SQJUQj6iUILHzTc8hcqoaEYehwbJwmH71PIe5paXzXWE\njZkR\r\n=eCzf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","readme":"# Dynamsoft JavaScript Barcode SDK for Node and Web\r\n\r\n![Dynamsoft JavaScript Barcode SDK](https://www.dynamsoft.com/blog/wp-content/uploads/2018/12/blog_dbr6.4.1db06493aba126f0c7f177687cf56a9038dd655a1fd2d4374ab571ce738111858.png)\r\n\r\nA **WebAssembly** barcode library for building JavaScript barcode detection apps.\r\n\r\n## Overview\r\n[Dynamsoft JavaScript Barcode Reader](https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx) is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR Code, DataMatrix, PDF417, and Aztec Code.\r\n\r\n## Supported Barcode Symbologies\r\n* 1D barcode: Code 39, Code 93, Code 128, Codabar, EAN-8, EAN-13, UPC-A, UPC-E, Interleaved 2 of 5 (ITF), Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5), ITF-14.\r\n* 2D barcode: QRCode, DataMatrix, PDF417, and Aztec Code.\r\n\r\n## Browser Compatibility\r\n\r\n| Browser | Version |\r\n|-|-|\r\n| Chrome | v57+ |\r\n| Firefox | v52+ |\r\n| Edge | v16+ |\r\n| Safari* | v11+ |\r\n| Internet Explorer | not supported |\r\n\r\n## Usage\r\n### Node\r\n\r\n```js\r\nvar dbr = require('dynamsoft-javascript-barcode');\r\ndbr.BarcodeReader.productKeys = 'LICENSE-KEY';\r\ndbr.BarcodeReader.createInstance().then(reader => {\r\n    reader.decode('sample.png').then(results => {\r\n        for(var i = 0; i < results.length; ++i){\r\n            console.log(results[i].BarcodeText);\r\n        }\r\n        reader.destroy();\r\n    });\r\n});\r\n```\r\n\r\n### Web\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n    <script src=\"node_modules/dynamsoft-javascript-barcode/dist/dbr.min.js\" data-productKeys=\"LICENSE-KEY\"></script>\r\n    <script>\r\n        let barcodeScanner = null;\r\n        Dynamsoft.BarcodeScanner.createInstance({\r\n            onFrameRead: results => {console.log(results);},\r\n            onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n        }).then(scanner => {\r\n            barcodeScanner = scanner;\r\n            barcodeScanner.show();\r\n        });\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n\r\nAlternatively, you can use the [jsDelivr](https://www.jsdelivr.com/) CDN as follows:\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7/dist/dbr.min.js\" data-productKeys=\"LICENSE-KEY\"></script>\r\n    <script>\r\n        let barcodeScanner = null;\r\n        Dynamsoft.BarcodeScanner.createInstance({\r\n            onFrameRead: results => {console.log(results);},\r\n            onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n        }).then(scanner => {\r\n            barcodeScanner = scanner;\r\n            barcodeScanner.show();\r\n        });\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n\r\nUse [Web Server for Chrome](https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb) for quick deployment.\r\n\r\n\r\n## API Reference\r\nhttps://www.dynamsoft.com/help/Barcode-Reader-wasm/index.html\r\n\r\n## Samples\r\n- samples/node\r\n- samples/web\r\n\r\nMore: https://github.com/dynamsoft-dbr/javascript-barcode\r\n\r\n## Online Demo\r\nhttps://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html\r\n\r\n![Web barcode reader](https://raw.githubusercontent.com/dynamsoft-dbr/javascript-barcode/master/img/dbr-wasm-demo-scaning.jpg)\r\n\r\n\r\n## License\r\nGet a [FREE 30-day trial license](https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx).\r\n\r\n## Contact Us\r\nhttps://www.dynamsoft.com/Company/Contact.aspx","gitHead":"97d3f33b1d30f3d4eee39a02b227b55e9f18c47a","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.1.0-beta.1_1566896141981_0.2945484686941955","host":"s3://npm-registry-packages"}},"7.1.0":{"name":"dynamsoft-javascript-barcode","version":"7.1.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.1.0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"6ad4b54a112a5df82c8dc8ec615b1b7dc7193f06","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.1.0.tgz","fileCount":111,"integrity":"sha512-bA5xsBchJU7pK75m1rAS6AwxAZxO6qxcCsDne22SIdvbffIqPg5PLCjheE1GKWZp5Dy4Y+eWO582JFtIULW26w==","signatures":[{"sig":"MEUCIQC9lD1BxKQYVu3gi64sGK520LUI2VRV9TqXA7ZfKpB2wAIgFyna/yACQjCQAfN19sAnQpkB6v3zOzz1DdE8/HQIZ9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7117321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaNIaCRA9TVsSAnZWagAAO2MP/RShaa8sprPD8OHA1xig\nn2RY1B7X9nbcgE1V/cCkkMK8mz83EHJ70J3sitfaOoo9SDZ+U89oOHMR0G+y\nxojUKqrWo5dd9SN0G5Nb9OPWNSavVHSo2wKOYPL1rW0ZAm+UxhFix+d9XCfU\nfGA6Wu0NbBzBOLjYblK9bkBkFpeQdF13EzOIqz5kTj5G8SzIk1fYQjW0wq8w\n8Jydqm1kbhOHSjS4T2obamyBoHC0O3yiOB/+4UnS6iijm6l824A69z/lBS8y\nC3VlfKEvTVbrxIUK4ODZSlO4MAykMrJUL8wlf8OpjiRVcsj0uZpGTZ7tc8xH\n4AcC57Ic5xJWvpb5byk+14PWbqtY3srI/3dd51gRtJXoaFNu/RQBtvXDbdx7\nE27w0OJoY0t3lSlcUUpO7Pv36xsxxlKzVnKOIcIlTgkfoz6cmQJ0xNMTVeBF\n2jjf8HAFom8R+Y/Qkva5ltgxRAzRYEi8IKtHBbAqaheg/FoLNHt4HdKCJWo+\nOx4qsyirVcNe+du4Z/mnltkqeYmj0QVIF5q8bjSiDht08W3j88bffhZhNNB2\nuD1LHXqFYTSSrC46QNrjdTHUPnEGuYu4BYwsEhOho6XEb+7ZbZ9/0OSZwhtP\n/36UDb78qimn3zyds+cf473vOTgV9o9oYpD/IY1M1fPp3FAfFUt1+GEZfJB3\ndr+E\r\n=b3eB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"30f7dc834e194aac9fb8bb0204a85437ca7b3ead","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.1.0_1567150618120_0.5849524758325024","host":"s3://npm-registry-packages"}},"7.1.1":{"name":"dynamsoft-javascript-barcode","version":"7.1.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.1.1","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"20a36086c8a8c3f9c4bfc24a6b2b1fd5613ba43f","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.1.1.tgz","fileCount":113,"integrity":"sha512-hvDqI1UjeABiPenaz4kX7fN1VrM6J8F+amuc/wawTmnZG3yhFNm3uHfX6S0q5beGJyRjZ1Nam6l424L8MN7Z4A==","signatures":[{"sig":"MEUCIFKBPa/FBsSXRLw0HKTG22DFoEXSN7Ddn/i5XCPQH5t0AiEA/uvSzQQtIhqPHiMB/4vJsrAs6V+f746g83CjCrNTZFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7202458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeah1CRA9TVsSAnZWagAAuAEQAIqzk4yUOW43E2LpLq+N\ntQbWHb2YvrJo3ngfn2mk0YpU9LeB8Em8KRCOu4dRWBGg9SYiuVhTg3NU+4ww\nnYfcOX0zTrsd8VNsbq3VXuObhOzDRHbSinakXHJvAC8KEMK/JmLssFLjWlip\nYMVALZVRtrYz/903105bfHJnW3NsOZXtKwpM7BIiN1HZXWp7CHkd9u76NPRV\n5A15F/trLKTPjEfihiQpUd2QD6U8FaacOaWhM9OaMf8XE3NZWi/gEGVLqhHX\nN0YywT5WIVxGfvYliVgyahpQiv5FiGykD7H4GaPLN9GNq6Ht8bfR3uR/r6ba\n0cawwjqmgOTkWmrBWZZyhD/m/jDnt6jUzArJ0lO+mK3PmxxgkalzVdsl9w6k\nRqjzg7O9pJpsPwj+tRh1xZCb3FohS+M7z4jmr60K3gxsyT+8RanV/2M4zmxD\nwaf/WzwPHBdmi1FfO4PKjJ5PKe44b+FcK9LuggWXoNtQviagy6NLXlIOg2MZ\nSr4wMJQYjJhGoAqQR1jrMYq7Y8j1+p9jvKZM6I8iBYtpk/dACH95lVwy6EzC\ndEZRL8NIW4Gwh6JrcQOM0Y0EYSRrbRm2RwRku/cuC7YnxwL8T4O5KP3GlyMP\n2gaV9HSEZLXQUH/NO0/0VbnFhIudBCAlMPMKE2tRTo14x2p/IoVE1UrmO5nc\niVdy\r\n=nphq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"e2ca9d09ce080ae7e5260b6776f0c53687fdeefb","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.1.1_1568254068288_0.34172271993222525","host":"s3://npm-registry-packages"}},"7.1.2":{"name":"dynamsoft-javascript-barcode","version":"7.1.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.1.2","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"df012b00aa7fa1e66e1456565c71352782a1e953","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.1.2.tgz","fileCount":248,"integrity":"sha512-GIkLI/NNuFTkXgDm/o7GB4JVgWyk7iAvMHVTbt5sJVoMfzCyusZI4+wvpAVctKt153zz3WujXJAaRPp4QHilKA==","signatures":[{"sig":"MEUCICUeehr7R0LXRHXUe6iEaZMyovV0arNEA5LmToL6D9v2AiEAieyy6l0gVLzmJLJzVVO0WUmXeihX+OSA8Iu7vWRVzaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12015473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrWGECRA9TVsSAnZWagAAy4YQAJ6IKoyWEssl+NwjaBFK\n4/d+9q9Z83YGl7eYqyQbfAosbsbiPwZ9beUbqJoSpQiZFrrLkPZPCRe5yHSH\nIna0nsUP48pIiMZsgTTcuRUASlmNzJ6MCBLxNgB88e+fskMDHsz+mkzJlyOF\nfoDMORmffCy68E71lv7MxZ3lMpUncSltGFyd8b98DC4XWxDNqNOvlVba6gM2\n3RpKjQkXOAMQsdayscVFZhbEBVfk+HcZ34j+0n/fdS1c318kA4a4hdIzqxS1\na8nYoD5XcPh4srJ/pdClxZAMHXzY692eFeUjb925umrEyrc7Xphiv0gkd6gw\nS0KwgJuJxKqIlRKdOaQ4wrtWUwNvXBySqgj/58XG5Ls5MNOpd1+o0r6eqr1u\n0QQDbB0N/8DLlxOsgksixeKZWeyA2g7pCI7ZSoCkFClzE0ibGCHdQ5HV3yhh\nPHTcrmfKHMqnYgYqCLu2wa3BLO9ro5LDlsMLCcq5J5mkK0Awl7P53opUxAch\n40jUAfwoBYq0uKb2EbAiaF/uD/2dPP5BucBP0GqybhOx5syShc4i1mGJQ5dm\nxdVHUV7inJgw5yACO2T7VZ3EFeuvMCwSdTJm07ugfjRWhOxcOX+9fxsFYt4T\nLCRb7cHTYQwcJTOugtntqsu8tyutoYfddi9mKCSAPvdPUnGgMt7SBdINU6sM\nQlk1\r\n=a1rH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"aa1f41d4f6d19a080058a4f1f84861f12b65d65a","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.1.2_1571643779056_0.8401679143314349","host":"s3://npm-registry-packages"}},"7.1.3":{"name":"dynamsoft-javascript-barcode","version":"7.1.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QR code","DataMatrix","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.1.3","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"ec5e56a8e246162fd97bcd7f9037bce7b92376f3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.1.3.tgz","fileCount":248,"integrity":"sha512-0+IElWVuGTORf1uW+3iiUovCaOD+zaArcu4iGh0bDjhQXGSNt+S/JyLLCk3shiFHxo1xZUvdnP+U3xsTopWwIg==","signatures":[{"sig":"MEUCIDhRe9500zeIwUoJa6ZWvXNbHEdpwQoYhXzZpWKI6C3lAiEA/4cNZqTdhw89YuBFmP3BdEESu5wS77xN+ZKG7eGygyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12015496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsRBICRA9TVsSAnZWagAACo4P/2OU1Veo3FEcVydatneB\nZywhBrth1s7C+en9aLAgmzYId2O0hE2PPyhGmXIKWiydMb90mNnmUe/HSftJ\nbwR0w0J7pnDzMSh2yAREZ45uKyn7WkQBKajRiof5gyhmsFDoEXEj2/8rV/yF\nLcXzn3B5neaUGbbrTulK1eGjodtq733gLjeYKHFsJpUGgoFgaFeCEnVSAPCi\nU+ea0YmMQNxbTj2SKi59eGgxgnqvy7B7yX4NDEoaU2BtyZOlz1asObCBdUZk\n3KjbduhvzoMOfoJuB11odxAIfQSOhcblPOsvUgxPYTmKUYQrXLAyUPjpS6e/\numrrtYnHbhWyKis5KNBlhq3IVzZmg9+m89yEA+zWh8me+k5ApQHHMHkEsZ1m\nfbjUMc3lLhu9Q2ZBN8MvpbffHLROzcoo+26kk4JnZyKaQq4EDVx4/C/py9us\nFAaFfxCKA6sTHshc9fhnGg5hgKR/1GJhwRKshmeTHIWyUZGr70vjm9FjKicn\n9mlCHi3HFJxNrkCdae1njEVdVReQqoT8nZyrLGS50iDG7gsCApLDuW6R2FJn\nqwNhReo+Kn2I51lpaDc7YSFJnttHBUYZ3k+CjmK5Rn3UoLSm45xqUuGt14DF\nFR1tsZHuc0RjveD86pBkr1VbhkMI087fV4MPiIA0TmvLhafJTSHBCz/vYr3N\nBeWP\r\n=sZts\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.min.js","types":"dist/dbr.d.ts","gitHead":"dac614f8033661901d85381dfaff8d612115862a","_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.1.3_1571885127726_0.005971575325032008","host":"s3://npm-registry-packages"}},"7.2.2-v2":{"name":"dynamsoft-javascript-barcode","version":"7.2.2-v2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.2.2-v2","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"92695243c85594f6a4e304eb4eae2fa4b3e2f123","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.2.2-v2.tgz","fileCount":301,"integrity":"sha512-yPprRtQPrNM1UQ/s9a6WWZKRtwI2SNF/mHiGamZsSzQfcpNZ6uS3Zrw6hJiz+1ykABuUZzIH3JRwVH/Sfw3/HQ==","signatures":[{"sig":"MEQCIEEvoUJPg+ccSSGQz61aj9KiDUvKM3Y30h3F65U7tN+7AiBlDG20AKe2hQItZqkW+oD0FyyyIr+oJspZIu47TgiTJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17821648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3doaCRA9TVsSAnZWagAAVpsP/04+idFHqCvfYlWWnqEY\n4lmo4acMpvjYGEHnRZf6skAiQ764y7J2IdBO7YeC+c+ClfsLqhJ3TryPUIJP\n8ehl8+KzAY9Lj5P+YBorMlfj9OmAgjBykfdYCbvLMKShhYXO6EHyPb4Lj1Cv\nUAdnLtGEymNRKGSq0DKLvu1iik5PrdJe7f9cFMbkrQ9zwbdSCXoeP8skdM7u\nBPCJZ5NXACOYLfqNcMCFg9cPPLFUvxG5xgTKg/MvSHKg72C3ewXGCLx9YGNt\nCUcOnN4056WVTejHV683RuF1WhuTwJJDX03g2IG8GqsuJjovCC9zpc5BUDSf\n3UPU1jPlWs1ewipkZzSuFoOgllC1x7MTDX2qbNZdlukuDJqOTGp+bhHM4HA7\nVrQpMsF1hzujIK09tAN1AwaLr3Ld3LOSt6C8gBOExlZfTPITjGO7GQ3bnXOu\nwHYQ009pr+VM2Pfg/ll4IeCnBrwSx/ORqSylRwQfXX91CPmYOUWOzhoPl7o8\nv2BbTNRjUFlXyL6h9Wsxoqfbe0wJIM3pg2Qpmz5t+sd69jS3qwR72nwJUOBm\nrHZDsHHwEgLIbL2XR2GEllTDKrU4WpnlJvVVrC6Tdwe2z8/N3qZmRa4gXiSo\nKYKIX5kXvg0gEbwf1Oh0INA0NM3QZogf4kCDXEU+mHjEG0u9m5n/Pn0FWhte\nzh/1\r\n=SR7/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","gitHead":"5000e82ddc4214fcee0709befb65ef7dfa346a2d","scripts":{"lint":"eslint ./src/ --ext .ts","test":"echo \"Error: no test specified\" && exit 1","build":"webpack --config webpack.config.js","build:doc":"typedoc --out \"doc/api reference\" --mode file --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"Dynamsoft BarcodeReader SDK for Javascript\""},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{"@types/node":"^12.7.5"},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.15.0","webpack":"^4.39.3","ts-loader":"^6.0.4","typescript":"^3.6.2","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","uglifyjs-webpack-plugin":"^2.2.0","@typescript-eslint/parser":"^2.0.0","awesome-typescript-loader":"^5.2.1","fork-ts-checker-webpack-plugin":"^1.5.0","@typescript-eslint/eslint-plugin":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.2.2-v2_1574820378183_0.16722255779349537","host":"s3://npm-registry-packages"}},"7.2.3-v2":{"name":"dynamsoft-javascript-barcode","version":"7.2.3-v2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.2.3-v2","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"656d846329fb5c25be76804ac0ca83727017f5e7","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.2.3-v2.tgz","fileCount":14,"integrity":"sha512-wLiMkRGrls1o9f5fCFZ6i9+WAVwUMH3fqsik0NJR/a8N+c5rJ2un3iNO91iEP38mA5b8s+2G5jvgYBE9UhN80g==","signatures":[{"sig":"MEQCIHDZRItjHkcLwIOLQhr5lnRyWgnLwY0M74I0LTlbBIudAiApT2COoi/ITPXgl3Jlc/79tjTiCE1UcJ5vI4+86g4gqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10868650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAXAnCRA9TVsSAnZWagAAwtgP/Aj6H73LVPKdJTNLteoK\nabVeBYiWZpSJuQK5/afQhX0Uh1zEFe12/pIEZx4PJImh4AFk4LGER1JfQunJ\nC5N+gtFhzhURfGSgxQ5HnUjWlYpkLKxfQl3GTlCNdIP3zCjlP60aUKLvd3AL\n9/QmVqqL8IsdZhG0zzi36NLE3y0tzRWMuZWgn3GXZcMoZY8l7XeTw8kaCajz\n9YVz81wwmE2m5YD0wVoSFshZonFapGD0uC18H3y6i+ZTcSKdzd9C/hCVkEEe\nqnSu6hhJRtnmcJbEy9aUmiWrwXJLGhLGCRreK6kcx+DNtTnd1lps2HAWJuv5\n38Cva5f5jkYcP9dWGVIRkBGkYWvEX1mCCU8mh4Mm+gFIOjxcM5IVz8znUHF8\nVbGpH70w93TF6mVKTiSXQfMxCIc1X+EUfz0Rve23gmidJ5qPo/EVs3l3infG\nEc+2IKeXFaXr0HpbzYdCab5tHjrrw9/Q/b2k61Z2YYgw+73sHBNZBvRy0hkr\nGawGhQNC83g9f2SRnSvVWDnb5PZCxbN+pAYwh+xeKCa5BGDtrxP5awaRf2/p\npuSus/eQz1sCn7BMIrx5JQZSJtTHeAg59qyyPJgRzUCD1/M62/4QqeLg6EJE\nBun8rtHb9fLcy/iWEkH1UOcAyaSbkIQKp5WqJE+RFAXI63P85eTF7Ur3h8lb\nisu/\r\n=+VMu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","readme":"# Dynamsoft JavaScript Barcode SDK for Web\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg) \r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\n![Dynamsoft JavaScript Barcode SDK](https://www.dynamsoft.com/blog/wp-content/uploads/2018/12/blog_dbr6.4.1db06493aba126f0c7f177687cf56a9038dd655a1fd2d4374ab571ce738111858.png)\r\n\r\n[Dynamsoft BarcodeReader SDK for Web](https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx) is a JavaScript API for barcode scanning based on the **WebAssembly** technology. It supports real-time localization and decoding of various barcode types. The library is capable of scanning barcodes from static images as well as directly from live video streams. It also supports reading multiple barcodes at once.\r\n\r\n> Also see [Dynamsoft JavaScript Barcode SDK for Node](https://github.com/dynamsoft-dbr/node-javascript-barcode).\r\n\r\n## Table of Contents\r\n- [Features](#features)\r\n- [Quick Usage](#quick-usage)\r\n- [Live Demo](#live-demo)\r\n- [Getting Started: HelloWorld](#getting-started-helloworld)\r\n- [Getting Started: Take a closer look](#getting-started-take-a-closer-look)\r\n  - [Initializing](#initializing)\r\n  - [Configuring Scanner Settings](#configuring-scanner-settings)\r\n  - [Customizing the UI](#customizing-the-ui)\r\n- [Advanced Usage](#advanced-usage)\r\n  - [Print out log for better debugging](#print-out-log-for-better-debugging)\r\n  - [Show found barcodes](#show-found-barcodes)\r\n  - [Read a specific area/region](#read-a-specific-arearegion)\r\n- [Self-hosted Deployment](#self-hosted-deployment)\r\n- [Changelog](#changelog)\r\n- [API Documentation](#api-documentation)\r\n- [License Activation](#license-activation)\r\n- [License Agreement](#license-agreement)\r\n- [Contact Us](#contact-us)\r\n\r\n## Features\r\n\r\n* Supported Symbologies: \r\n\r\n  1D barcode: **`Code 39`**(including Code 39 Extended), **`Code 93`**, **`Code 128`**, **`Codabar`**, **`EAN-8`**, **`EAN-13`**, **`UPC-A`**, **`UPC-E`**, **`Interleaved 2 of 5`** (ITF), **`Industrial 2 of 5`** (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5), **`ITF-14`** .\r\n  \r\n  2D barcode: **`PDF417`**, **`QR`**, **`DataMatrix`**, **`Aztec`**, and **`MaxiCode`**.\r\n\r\n  Patch Code\r\n\r\n  GS1 Composite Code\r\n\r\n  GS1 DataBar: **`Omnidirectional`**, **`Truncated`**, **`Stacked`**, **`Stacked Omnidirectional`**, **`Limited`**, **`Expanded`**, and **`Expanded Stacked`**.\r\n\r\n* Supported Data Sources: **`Blob`**, **`HTMLImageElement`**, **`HTMLVideoElement`**, and **`URL`**, etc.\r\n\r\n* Browser Compatibility:\r\n\r\n  | Browser Name | Version |\r\n  |:-:|:-:|\r\n  | Chrome | v57+ (v59+ on Android/iOS<sup>1</sup>) |\r\n  | Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>) |\r\n  | Edge<sup>2</sup> | v16+ |\r\n  | Safari<sup>3</sup> | v11+ |\r\n\r\n  <sup>1</sup> On iOS, camera video streaming only works in Safari.\r\n\r\n  <sup>2</sup> On Edge, due to blob worker can't access to indexedDB, you must host DBRJS SDK in the same domain.\r\n\r\n  <sup>3</sup> Safari 11.2.2 ~ 11.2.6 are not supported.\r\n\r\n* Simplified and Full Feature Edition\r\n\r\n  As more and more features are added to the SDK, the wasm file is getting bigger and bigger. Based on the consideration of network and compilation performance, we divided the wasm into a simplified version and a full feature version in 7.2.2.\r\n\r\n  | feature | simplified edition | full feature edition |\r\n  |:-:|:-:|:-:|\r\n  | wasm size<sup>1</sup>\\(gzip\\) | 810KB | 1.1 MB |\r\n  | 1D | &radic; | &radic; |\r\n  | QR | &radic; | &radic; |\r\n  | PDF417 | &radic; | &radic; |\r\n  | DataMatrix | &radic; | &radic; |\r\n  | Aztec | X | &radic; |\r\n  | MaxiCode | X | &radic; |\r\n  | Patch Code | X | &radic; |\r\n  | GS1 Composite Code | X | &radic; |\r\n  | GS1 DataBar | X | &radic; |\r\n  | DPM | X | &radic; |\r\n  | getRuntimeSettings | &radic; | &radic; |\r\n  | updateRuntimeSettings | &radic; | &radic; |\r\n  | getIntermediateResults | X | &radic; |\r\n  | initRuntimeSettingsWithString | X | &radic; |\r\n  | outputSettingsToString | X | &radic; |\r\n  | outputSettingsToString | X | &radic; |\r\n  | scenarios<sup>2</sup> | To C | To B  |\r\n\r\n  <sup>1</sup> The wasm size is measured in 7.2.2. In later version the size may different.\r\n\r\n  <sup>2</sup> The simplified edition download and compile faster. Suitable for the scenario that scanning a few codes and redirecting to another page. When you need the feature only in the full, or scenarios that are less sensitive to initialization speed, such as long time video decoding and decoding barcodes in image files, use the full feature edition.\r\n\r\n  The simplified edition is default used. To switch to full feature edition, use the api `Dynamsoft.BarcodeReader._bUseFullFeature = true`. `_bUseFullFeature` must be set before `loadWasm`.\r\n\r\n## Quick Usage\r\n<!-- ### Node\r\n\r\n```js\r\nlet Dynamsoft = require('dynamsoft-node-barcode');\r\n// Please visit https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx to get a trial license\r\nDynamsoft.BarcodeReader.productKeys = 'PRODUCT-KEYS';\r\n\r\n(async()=>{\r\n    let reader = await Dynamsoft.BarcodeReader.createInstance();\r\n    for(let result of await reader.decode('https://demo.dynamsoft.com/dbr/img/AllSupportedBarcodeTypes.png')){\r\n        console.log(result.barcodeText);\r\n    }\r\n    reader.destroy();\r\n    process.exit();\r\n})();\r\n``` -->\r\n\r\n### Web\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n    <script>\r\n        let barcodeScanner = null;\r\n        Dynamsoft.BarcodeScanner.createInstance({\r\n            onFrameRead: results => {console.log(results);},\r\n            onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n        }).then(scanner => {\r\n            barcodeScanner = scanner;\r\n            barcodeScanner.show();\r\n        });\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n\r\n## Live Demo\r\n\r\nThe following is a screenshot of the live demo. Try it [here](https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html).\r\n\r\n<img src=\"https://raw.githubusercontent.com/dynamsoft-dbr/javascript-barcode/dac614f8033661901d85381dfaff8d612115862a/img/dbr-wasm-demo-scaning.jpg\">\r\n\r\n\r\n\r\n## Getting Started: HelloWorld\r\n\r\nThis section will help you use the library to build a simple web application to decode barcodes from a video stream. \r\n\r\n**Basic Requirements**:\r\n\r\n* Internet connection\r\n\r\n* Camera Access\r\n\r\n### Step One: Write the code in minutes!\r\n\r\nCreate an HTML file with the following content. Deploy it to your web server if you have it already. \r\n\r\n* The sample is missing one piece of information to actually work which is the field `PRODUCT-KEYS`, you can acquire a trial key [here](https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx) and replace the field with your key.\r\n* If you don't have a ready-to-use web server and you happen to have a package manager like `npm` or `yarn`, you can set up a simple http server in minutes. Check out http-server on [npm](https://www.npmjs.com/package/http-server) or [yarn](https://yarnpkg.com/en/package/http-server).\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n    <!-- Please visit https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx to get a trial license. -->\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n    <script>\r\n        let barcodeScanner = null;\r\n        Dynamsoft.BarcodeScanner.createInstance({\r\n            onFrameRead: results => {console.log(results);},\r\n            onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n        }).then(scanner => {\r\n            barcodeScanner = scanner;\r\n            barcodeScanner.show();\r\n        });\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/)\r\n\r\n### Step Two: Tackle a few issues\r\n\r\nOpen the file in your browser (must be one that is supported) and there will be a pop-up asking for permission to access the camera. Once the access is granted, you will see the video stream in the default UI of the **BarcodeScanner**. \r\n\r\n##### **General Issue one**\r\n\r\nIf you open the HTML file as `file:///` or `http://`, the following error may appear in the browser console\r\n\r\n> [Deprecation] getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.\r\n\r\nIn Safari 12 the error is\r\n\r\n> Trying to call getUserMedia from an insecure document.\r\n\r\nAs the error states, to access the camera with the API [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia), a secure channel (`https://`) is required.\r\n\r\n> If you use Chrome or Firefox, you might not get the error because these two browsers allow camera access via `file:///` and `http://localhost`.\r\n\r\nTo make sure your web application can access the camera, try to configure your web server to support HTTPS. The following links may help.\r\n\r\n- NGINX: [Configuring HTTPS servers](https://nginx.org/en/docs/http/configuring_https_servers.html)\r\n- IIS: [Create a Self Signed Certificate in IIS](https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/)\r\n- Tomcat: [Setting Up SSL on Tomcat in 5 minutes](https://dzone.com/articles/setting-ssl-tomcat-5-minutes)\r\n- Node.js: [npm tls](https://nodejs.org/docs/v0.4.1/api/tls.html)\r\n\r\n##### **General Issue Two**\r\n\r\nFor testing purposes, a self-signed certificate can be used when configuring HTTPS. When accessing the site, the browser might say \"`the site is not secure`\". In this case, go to the certificate settings and trust this certificate. \r\n\r\n> In a production environment, you will need a valid HTTPS certificate that does not have this issue. If you don't have one yet, you can get a free one from [Let’s Encrypt](https://letsencrypt.org/). Of course, you are advised to apply for a paid certificate from companies such as Verisign, GeoTrust, etc.\r\n\r\n### Step Three: Time to scan!\r\n\r\nPut something with a barcode in front of the camera and you'll see it located and decoded right in the UI.\r\n\r\n### Step Four: Dive into the code\r\n\r\nNow, take a look at the sample code. You can find that there is nothing but two scripts inside the `<body>`\r\n\r\n* The following script includes the core library in the application via a [jsDelivr](https://www.jsdelivr.com/) CDN\r\n  \r\n  ```javascript\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n  ```\r\n  \r\n  The same can be done with other CDNs like unpkg as well\r\n  \r\n  ```javascript\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n  ```\r\n\r\n  The api may change slightly between versions. Please use a specific version in your production environment to ensure stability.\r\n\r\n* The following script initializes and uses the library:\r\n  \r\n  ```javascript\r\n  <script>\r\n      let barcodeScanner = null;\r\n      Dynamsoft.BarcodeScanner.createInstance({\r\n          onFrameRead: results => {console.log(results);},\r\n          onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n      }).then(scanner => {\r\n          barcodeScanner = scanner;\r\n          barcodeScanner.show();\r\n      });\r\n  </script>\r\n  ```\r\n  For now, pay attention to the following two events.\r\n\r\n    * `onFrameRead`\r\n      This event is triggered after a single frame is scanned. The `results` object contains all the barcode results that the library found on this frame.\r\n  * `onUnduplicatedRead`\r\n      This event is triggered when a new barcode (not a duplicate) is found. `txt` holds the barcode text value while `result` is an object that holds details of the found barcode.\r\n\r\nIn the following sections, you'll find more detailed information on how the library works and how you can customize it to your needs.\r\n\r\n## Getting Started: Take a closer look\r\n\r\n### Initializing\r\n\r\nThe library is based on the WebAssembly standard, therefore, **on first use**, it needs some time to download and compile the WebAssembly files. After the first use, the program can cache the file so that the next time you can start from compiling. \r\n\r\n`Dynamsoft.BarcodeReader.loadWasm` is the API used to start the initialization. \r\n\r\nUse the following code to listen to the initialization process:\r\n\r\n```javascript\r\nDynamsoft.BarcodeReader.loadWasm()\r\n    .then(()=>{ /* success */ }, ex=>{console.error(ex.message||ex);})\r\n```\r\n\r\nHowever, other APIs like `Dynamsoft.BarcodeReader.createInstance`, `Dynamsoft.BarcodeScanner.createInstance` will call `loadWasm` internally. So you can listen to the initialization process during `createInstance`:\r\n\r\n```javascript\r\nDynamsoft.BarcodeReader.createInstance()\r\n    .then(reader=>{ /* success */ }, ex=>{console.error(ex.message||ex);})\r\n```\r\n\r\n> Including the library with a script tag doesn't automatically initializes the library. When you want to load wasm in advance, and create a reader or scanner instance later, it is a good choice can call `loadWasm`.\r\n\r\nThe detailed initialization includes the following steps:\r\n\r\n#### 1. Download\r\n\r\nDownload the necessary resources. Usually we deploy the resources on cdn and set a long cache duration. The speed of cdn will greatly affect the feeling of the first experience. The resources can be obtained from the cache on the next visit.\r\n\r\n#### 2. Compile\r\n\r\nThe WebAssembly files are automatically compiled once downloaded. The compilation time varies among different devices & browsers. While it takes less than a second on latest phones or PCs, it may take seconds on some older devices. \r\n\r\n#### 3. Initialize\r\n\r\nThe library needs to initialize every time the page loads.\r\n\r\n\r\n### Configuring Scanner Settings\r\n\r\nWhen creating an instance of the `BarcodeScanner` object, there are a number of configuration options. The following code shows some of the most useful ones:\r\n\r\n```js\r\nlet barcodeScanner = null;\r\nDynamsoft.BarcodeScanner.createInstance({\r\n    // The following two callbacks are explained in previous context\r\n    onFrameRead: results => {console.log(results);},\r\n    onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n}).then(async scanner => {\r\n    barcodeScanner = scanner;\r\n    // updateVideoSettings sets which camera and what resolution to use\r\n    await barcodeScanner.updateVideoSettings({ video: { width: 1280, height: 720, facingMode: \"environment\" } });\r\n\r\n    let runtimeSettings = await barcodeScanner.getRuntimeSettings();\r\n    // Specify which symbologies are to enabled\r\n    runtimeSettings.barcodeFormatIds = Dynamsoft.EnumBarcodeFormat.BF_ONED | Dynamsoft.EnumBarcodeFormat.BF_QR_CODE;\r\n    // By default, the library assumes accurate focus and good lighting. The settings below are for more complex environments. Check out according API descriptions for more info.\r\n    runtimeSettings.localizationModes = [\r\n        Dynamsoft.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n        Dynamsoft.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n        Dynamsoft.EnumLocalizationMode.LM_STATISTICS,\r\n        Dynamsoft.EnumLocalizationMode.LM_LINES,\r\n        0,0,0,0\r\n    ];\r\n    // Discard results which have a low confidence score.\r\n    runtimeSettings.minResultConfidence = 30;\r\n    await barcodeScanner.updateRuntimeSettings(runtimeSettings);\r\n\r\n    let scanSettings = await barcodeScanner.getScanSettings();\r\n    // Disregard duplicated results found in a specified time period\r\n    scanSettings.duplicateForgetTime = 20000;\r\n    // Set a interval so that the CPU can relax\r\n    scanSettings.intervalTime = 300;\r\n    await barcodeScanner.updateScanSettings(scanSettings);\r\n    barcodeScanner.show();\r\n})\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see in the code, there are basically three categories of configurations.\r\n\r\n* `get/updateVideoSettings`: Configures the data source, I.E., the video stream. These settings include which camera to use , the resolution, etc.. Check out more information [here](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax).\r\n* `get/updateRuntimeSettings`: Configures the decode engine. Find a full list of these settings and their corresponding descriptions [here](https://www.dynamsoft.com/help/Barcode-Reader/struct_dynamsoft_1_1_barcode_1_1_public_runtime_settings.html). Below lists the recommended settings for specific usage.\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/)\r\n  \r\n  **fast**\r\n  \r\n  ```javascript\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [Dynamsoft.EnumLocalizationMode.LM_STATISTICS, 0, 0, 0, 0, 0, 0, 0];\r\n  settings.deblurLevel = 0;\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n  **1D**\r\n  ```javascript\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n        Dynamsoft.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n        Dynamsoft.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n        Dynamsoft.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0];\r\n  settings.deblurLevel = 0;\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n  **2D**\r\n  \r\n  ```javascript\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n        Dynamsoft.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n        Dynamsoft.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n        Dynamsoft.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0];\r\n  settings.deblurLevel = 2;\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n* `get/updateScanSettings`: Some settings about video scanning, include `duplicateForgetTime`, `intervalTime` and `filter`.\r\n\r\n### Customizing the UI\r\n\r\nWhile the library provides a built-in `BarcodeScanner` which has its own UI, you are free to use your own UI. Check out the following code on how it's done.\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n    <div id=\"div-video-container\">\r\n        <video class=\"dbrScanner-video\" playsinline=\"true\"></video>\r\n    </div>\r\n    <!-- Please visit https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx to get a trial license. -->\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n    <script>\r\n        let barcodeScanner = null;\r\n        Dynamsoft.BarcodeScanner.createInstance({\r\n            UIElement: document.getElementById('div-video-container'),\r\n            onFrameRead: results => {console.log(results);},\r\n            onUnduplicatedRead: (txt, result) => {alert(txt);}\r\n        }).then(scanner => {\r\n            barcodeScanner = scanner;\r\n            barcodeScanner.show();\r\n        });\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\nThe code has specified the `UIElement` with the ID `div-video-container`  as the data source element and has put a video element inside to show the camera video stream.\r\n\r\n> **Important**: The class name of the video element must be `dbrScanner-video`.\r\n>\r\n> ```html\r\n> <video class=\"dbrScanner-video\" playsinline=\"true\"></video>\r\n> ```\r\n\r\nNext, you can add the camera list and resolution list.\r\n\r\n> If the class names match the default ones which are `dbrScanner-sel-camera` and `dbrScanner-sel-resolution`, the library will automatically populate the lists and handle the camera/resolution switching automatically.\r\n\r\n```html\r\n<select class=\"dbrScanner-sel-camera\"></select>\r\n```\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n```html\r\n<select class=\"dbrScanner-sel-resolution\"></select>\r\n```\r\n\r\n> 8 default resolutions will automatically show up.\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\nToo many resolutions may be overwhelming for end users. Check out the following code on how to offer your own resolution options.\r\n\r\n```html\r\n<select class=\"dbrScanner-sel-resolution\">\r\n    <option class=\"dbrScanner-opt-gotResolution\" value=\"got\"></option>\r\n    <option data-width=\"1920\" data-height=\"1080\">1920 x 1080</option>\r\n    <option data-width=\"1280\" data-height=\"720\">1280 x 720</option>\r\n    <option data-width=\"640\" data-height=\"480\">640 x 480</option>\r\n</select>\r\n```\r\n\r\n> **Possible Issue**: Generally you need to provide a resolution that the camera supports. However, in case a camera does not support a specified resolution, it usually will just use the nearest supported resolution. As a result, the selected resolution may not be the actual resolution. \r\n>\r\n> **Resolution**: To take care of this issue, you can add a option with the class name `dbrScanner-opt-gotResolution` (as shown above) which the library will then use to show the actual resolution being used.\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n#### Customizing Further\r\n\r\nYou may not want to use elements with the default class names to show the camera list or resolution list. In this case, you need to populate the two lists yourself.\r\n\r\nFor camera list, you can use the API `getAllCameras()` to get all available cameras and then populate them on the page.\r\n\r\n```HTML\r\n<select id=\"custom-camera-list\"></select>\r\n```\r\n\r\n```javascript\r\nlet currentCamera = \"\";\r\nlet cameraList = document.getElementById(\"custom-camera-list\");\r\nbarcodeScanner.show()\r\n    .then(() => barcodeScanner.getCurrentCamera())\r\n    .then(camera => {\r\n        currentCamera = camera;\r\n    })\r\n    .then(() => barcodeScanner.getAllCameras())\r\n    .then(allCameras => {\r\n        cameraList.options.length = 0;\r\n        for (let i = 0; i < allCameras.length; i++) {\r\n            let camera = allCameras[i];\r\n            cameraList.options.add(new Option(camera.label, camera.deviceId));\r\n            if (camera.deviceId == currentCamera.deviceId)\r\n                cameraList.selectedIndex = i;\r\n        }\r\n    });\r\n```\r\n\r\nSwitch to the selected camera.\r\n\r\n```js\r\ncameraList.onchange = () => {\r\n    barcodeScanner.setCurrentCamera(cameraList.options[cameraList.selectedIndex].value);\r\n};\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2L9ta7mj/)\r\n\r\nIf you have more than one camera and would like to use a certain one of them. Try out the code below.\r\n\r\n```js\r\nbarcodeScanner.show()\r\n    .then(() => barcodeScanner.getAllCameras())\r\n    .then(allCameras => {\r\n        for (let camera of allCameras) {\r\n            if (camera.label == 'Your-Camera-Name') {\r\n                barcodeScanner.setCurrentCamera(camera.deviceId);\r\n                break;\r\n            }\r\n        }\r\n    });\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/kLvgt3w2/)\r\n\r\nFor resolution list, you can show your preferred resolutions and use the API `setResolution` to set the selected option.\r\n\r\n```html\r\n<select id=\"custom-camera-resolution\">\r\n    <option data-width=\"1920\" data-height=\"1080\">1920 x 1080</option>\r\n    <option data-width=\"1280\" data-height=\"720\">1280 x 720</option>\r\n    <option data-width=\"640\" data-height=\"480\">640 x 480</option>\r\n</select>\r\n```\r\n\r\n```javascript\r\nlet resolutionList = document.getElementById(\"custom-camera-resolution\");\r\nresolutionList.onchange = () => {\r\n    barcodeScanner.setResolution(\r\n        resolutionList.options[resolutionList.selectedIndex].getAttribute(\"data-width\"),\r\n        resolutionList.options[resolutionList.selectedIndex].getAttribute(\"data-height\")\r\n    );\r\n};\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/djhvno5b/)\r\n\r\n## Advanced Usage\r\n\r\n### **Print out log for better debugging**\r\nInclude the following in your code to print internal logs in the console.\r\n\r\n```javascript\r\nDynamsoft.BarcodeReader._onLog = console.log;\r\n```\r\n\r\n### Show found barcodes\r\n\r\nTry the following code to show found barcodes in `input` elements on the page\r\n```html\r\n<input id=\"ipt-0\">\r\n<input id=\"ipt-1\">\r\n<input id=\"ipt-2\">\r\n```\r\n\r\n```js\r\nlet iptIndex = 0;\r\nlet barcodeScanner = null;\r\nDynamsoft.BarcodeScanner.createInstance({\r\n    UIElement: document.getElementById('div-video-container'),\r\n    onFrameRead: results => {console.log(results);},\r\n    onUnduplicatedRead: (txt)=>{\r\n        document.getElementById('ipt-' + iptIndex).value = txt;\r\n        if(3 == ++iptIndex){\r\n            barcodeScanner.onUnduplicatedRead = undefined;\r\n            // Hide the scanner if you only need to read these three barcodes\r\n            barcodeScanner.hide();\r\n        }\r\n    }\r\n}).then(scanner => {\r\n    barcodeScanner = scanner;\r\n    barcodeScanner.show();\r\n});\r\n```\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tz9ngm2a/)\r\n\r\n###\tRead a specific area/region\r\n\r\nTo speed up the scanning process, you can choose to scan only a specific area/region.\r\n\r\n```javascript\r\nlet settings = await barcodeScanner.getRuntimeSettings();\r\n/*\r\n * 1 means true\r\n * Using a percentage is easier\r\n * The following code ignores 25% to each side of the video stream\r\n */\r\nsettings.region.regionMeasuredByPercentage = 1;\r\nsettings.region.regionLeft = 25;\r\nsettings.region.regionTop = 25;\r\nsettings.region.regionRight = 75;\r\nsettings.region.regionBottom = 75;\r\nawait barcodeScanner.updateRuntimeSettings(settings);\r\n```\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/taykq592/)\r\n\r\n## Self-hosted Deployment\r\n\r\nFor commercial usage, we highly recommend self-hosted deployment. The following steps guide you through how to deploy the library on your own server.\r\n\r\n* **Step one**: Place the files\r\n  \r\n\r\nCreate a directory called `dist` on your server and put the following files in there.\r\n\r\n> [Download zip](https://www.dynamsoft.com/Downloads/Dynamic-Barcode-Reader-Download.aspx?edition=js) to get these files.\r\n\r\n  ```\r\n  dbr-<version>.js\r\n  dbr-<version>.worker.js\r\n  dbr-<version>.wasm.js\r\n  dbr-<version>.wasm\r\n  dbr-<version>.full.wasm.js\r\n  dbr-<version>.full.wasm\r\n  ```\r\n\r\n* **Step two**: Configure the server\r\n  \r\n  Make sure that your webserver serves the `*.wasm` file with `Content-Type: application/wasm` . Otherwise the browser won't be able to recognize it.\r\n  \r\n  Basically, all you need to do is set the MIME type for `.wasm`  to `application/wasm`.\r\n  \r\n  > Different servers are configured differently, below lists a few popular ones\r\n  >\r\n  > * NGINX: [mime.types](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n  > * IIS: [Web.config](https://github.com/dynamsoft-dbr/javascript-barcode/blob/dac614f8033661901d85381dfaff8d612115862a/documents/conf/Web.config)\r\n  > * Java&trade; EE web app: [web.xml](https://github.com/dynamsoft-dbr/javascript-barcode/blob/dac614f8033661901d85381dfaff8d612115862a/documents/conf/web.xml)\r\n  > * Node.js: [npm mime](https://github.com/broofa/node-mime)\r\n\r\n\r\n\r\n## Changelog\r\n\r\nhttps://www.dynamsoft.com/Products/Dynamic-Barcode-Reader-News.aspx#javascript\r\n\r\n## API Documentation\r\n\r\n<!--for github: link need use online-->\r\n\r\n[Online Document](https://www.dynamsoft.com/help/Barcode-Reader-wasm/)\r\n\r\n<!-- Decoding Images: [BarcodeReader](https://www.dynamsoft.com/help/Barcode-Reader-wasm/classes/barcodereader.html)\r\n\r\nDecoding Video Stream: [BarcodeScanner](https://www.dynamsoft.com/help/Barcode-Reader-wasm/classes/barcodescanner.html) -->\r\n\r\n## License Activation\r\n\r\nIt takes several steps to activate a purchased license, the following steps assume you have already acquired a commercial license from Dynamsoft. If you haven't done so, you can purchase [here](https://www.dynamsoft.com/Secure/Barcode-Reader-BuyIt.aspx).\r\n\r\n* **Step One** : Create a Dynamsoft Account \r\n\r\n  If you don't have a Dynamsoft Account yet, sign up [here](https://www.dynamsoft.com/CustomerPortal/Account/Registration.aspx).\r\n\r\n* **Step Two** : Log into Dynamsoft Customer Portal \r\n\r\n  Once logged in, click **Barcode Reader SDK** on the menu bar on the left under **License Center** and you should be able to see your purchased key on the right pane.\r\n\r\n* **Step Three** : Activate the License\r\n\r\n  Under **Status**, click the link **Activate Now** where you will be asked to input a domain which your license key will be bound to. The domain binding is a security feature to protect your license, although it's optional, it's highly recommended.\r\n\r\n  > A few examples of the domain\r\n  >\r\n  > www.dynamsoft.com\r\n  >\r\n  > demo.dynamsoft.com\r\n  >\r\n  > \\*.dynamsoft.com\r\n  >\r\n  > \\*.dynamsoft.com;\\*.yoursite.com\r\n\r\n* **Step Four** : Use the License\r\n\r\n  You may have noticed that in all the samples above, we have the following line of code\r\n\r\n  ```html\r\n  <!-- Please visit https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx to get a trial license. -->\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js\" data-productKeys=\"PRODUCT-KEYS\"></script>\r\n  ```\r\n\r\n  To use your license, you simply need to replace `PRODUCT-KEYS` with it.\r\n\r\n## License Agreement\r\n\r\nhttps://www.dynamsoft.com/Products/barcode-reader-license-agreement.aspx#javascript\r\n\r\n## Contact Us\r\nIf there are any questions, please feel free to contact <support@dynamsoft.com>.\r\n\r\n","gitHead":"a391e9d1270e61e7fe5f09381779b3fe890f0e3b","scripts":{"test":"node test","build":"webpack --config webpack.config.js","build:doc":"typedoc --out \"doc/api reference\" --mode file --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"Dynamsoft BarcodeReader SDK for Javascript\"","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.9.0","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.16.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typedoc":"^0.15.0","webpack":"^4.39.3","ts-loader":"^6.0.4","typescript":"^3.6.2","@types/node":"^12.12.14","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","uglifyjs-webpack-plugin":"^2.2.0","ts-declaration-webpack-plugin":"^1.2.0","fork-ts-checker-webpack-plugin":"^1.5.0","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.2.3-v2_1577152550474_0.18023668694235306","host":"s3://npm-registry-packages"}},"7.3.0-v0":{"name":"dynamsoft-javascript-barcode","version":"7.3.0-v0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.3.0-v0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"b8e1c8f3986fcfdae57f4ec01738320c565051c3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.3.0-v0.tgz","fileCount":17,"integrity":"sha512-wlhvDBwzlRANpUwLi/EwZrDtrRN1NMLNIeZNWPAWA6p1bIvWZRrXUdxO0JuQ2sqy8HwtXgXJz620HeletDLW6g==","signatures":[{"sig":"MEQCIAdR3BwY2ZjFJ8TGBBru2KABsI/RaTVAimtE+CJET5BqAiACJhTg4L5XPtRl9q45tbVz78Eu4L6HIscYSB67k0m4pA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12220992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHmKKCRA9TVsSAnZWagAAzOwP/RLqob5vWrR4088ZaqJk\n/+4a72hvprZcmzaA8kDKvUWg/4rZv7LxxToxtPC0JhSGOBoLNGq/s9ptZDvg\n1ujGUZ449EyT3HJy3F61qPKNuk9sKMCw5s3ghHL1xhy60lJfx7aSYjdABkRe\n3TUL0puUCq+tzjjTGVEjcM2HD9L2GdbDNkmLISVRGBWfGyao06U7ZOngGzF+\n/aKubzy0gWqpUac4yLr1Pj+Lt87kl4NW7jg9zj73kNCSBprLZk4Q546di//D\nxuTf+webu6f9x2JDD/UTBy9uzS5xeaseBWFubNCf1RNYB6ERIXiQ2vZnTccD\ndCraBO5f2JJBtQ2Bfwm1cYskN1A6jItj4creXjghwQGf4uh/E5ctDiDf8L6+\n1NxOvI9uCzYh7qdmS0aOyO/aqnnGFFVI0kGVQ8TuSirkGloxNHRW6DjDEZH0\nk7drZyEEEw1XJN4Eq5Xr9gtBJgSa9C0EyaF86VqDkf0EDNRvS3x+M1MfEOLY\n1crLYsFgFRspnIxkb1K5BG5oDW/60gbJubE/81CCUBlzdtA4xopi4NLB4WvJ\nA2CmEk7906yQvcP4I1bxogp+Fo5mWAuiAiVFg2fsmk9nJ4tXfs7YxNwgxdfS\nAGZKiesTpqJuko3N/T8+2iIjUmqTkTMhQQ4zdO2zCBNO1laG5k3JEOgSBRsv\n5tWj\r\n=dhhd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"55148239ab4d4adc38275806bc74e0dabc9b8e48","scripts":{"test":"node test","build":"webpack --config webpack.config.js","build:doc":"typedoc --out \"doc/api reference\" --mode file --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"Dynamsoft BarcodeReader SDK for Javascript\"","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.15.0","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.0.4","typescript":"^3.6.2","@types/node":"^12.12.14","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","uglifyjs-webpack-plugin":"^2.2.0","ts-declaration-webpack-plugin":"^1.2.0","fork-ts-checker-webpack-plugin":"^1.5.0","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.3.0-v0_1579049609595_0.05866524462509215","host":"s3://npm-registry-packages"}},"7.3.0-v1":{"name":"dynamsoft-javascript-barcode","version":"7.3.0-v1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.3.0-v1","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"7c63b6a384f744a32d122335a9148de66d2e2bcf","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.3.0-v1.tgz","fileCount":17,"integrity":"sha512-NHFCKaTHLaJSW3FIQPTX31i6N0KyLyO43m8AtVBMoaFNc9lbme7wWsobLFUtKe5ojIWzXbTJtoJFz7TFaH3Ffw==","signatures":[{"sig":"MEUCIQDOTsOD4A8884Bo7w2tyPVXWJOjE+5BJ4Zhw1oAWJz89wIge5LWVmRWKcm22pQsjt1rAqxvJbSE+WyQ3REVIUED9Z0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12226645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJWw2CRA9TVsSAnZWagAAMTIP/R0UrhksEXfv0rRAUMx4\nBZXt3Ub3Ro7pkmy6wUbH0w2hWhX3hF4B5H0zOkoZauWaZoPQhq5aH6V5Bc1w\nwPN7wcMtWx51WxFQIB8k2um1QuF/cIj53PBjyS8b+YwzoZUMPBDygcr2GSEx\nR0RxRxJo/ZCm0FM4i8L50b2RqRW01SchG8mD/7ho36sY+XZQ1uTu49D7vt/m\nXpxjE47OlHa/24Wq1IMNLOrW1SZDKr9ryxfAgUpWoxAWRHpHc5wZciGZ1raA\nQREJhrmn0L59pnK3GymWLgbbDIA2mhJGjvMj2Dp4q9waj5Nng/ujKEZmQdm9\nn8oBT8RFAlt9LGVrTEsrLaHS4sGfoJ2jU66v/6fNnVIYzZd94bVL+mWLhsDI\nByWntuJIOz/Lm51J5Sto6fK1YhR7JIwzKjO0BB0A47WSOX/VeEvasEndRnzc\nrtddLJYHPTj0PmJNSLzg0HbLjQijGG4g25xb/UVW1H84HkJxrMzZU+Pcyg0p\nU28+r5VrBXuJZrvgAekj7x4DoUkEJy+F/Uaolkcw1Jhwb2KYjRq/8dZfqdmT\na15Y4i10ZrIANmQ6323LrqOhrcexNWUm9bsK84q7UQfFMANe1SaGEWboTadc\nQjZiNEdH7CGAhnj3lEKN4TpQ/bL0nyhFigr/DkMif6emPQfT+q+MsfKw892P\nN4zT\r\n=9xhc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"1baa2b8d190814656cc4d55a77b55138eb14ccfc","scripts":{"test":"node test","build":"webpack --config webpack.config.js","build:doc":"typedoc --out \"doc/api reference\" --mode file --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"Dynamsoft BarcodeReader SDK for Javascript\"","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.15.0","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.0.4","typescript":"^3.6.2","@types/node":"^12.12.14","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","uglifyjs-webpack-plugin":"^2.2.0","ts-declaration-webpack-plugin":"^1.2.0","fork-ts-checker-webpack-plugin":"^1.5.0","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.3.0-v1_1579510838117_0.2113588554367143","host":"s3://npm-registry-packages"}},"7.3.0-v2":{"name":"dynamsoft-javascript-barcode","version":"7.3.0-v2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.3.0-v2","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"dd57db6d37ed6e02850b1374c4c7ba2d47faebf6","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.3.0-v2.tgz","fileCount":17,"integrity":"sha512-0AL+hjXe0a7yZdxiAjk5upTGgP58tyQ/LhUvNbLcmFCI/F9EyMTn79Z3ECzzKPNNvd9r6ghS2iB1eQmKis4JGw==","signatures":[{"sig":"MEYCIQC1LmocDCjOaEJp0rQXwe42ZjjyusGwJFXVKyoPIJl28wIhAOLPMOzbOb0R19RNwNDwMzrTO+KSfYA5K1jLugf1BacH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12231912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRkedCRA9TVsSAnZWagAAIPwP/36LQCP/vU9juV6QyGN6\n4WtuS5oXkbWvHigRgDODvuq968CGgDmol4kluWLP8kD7V2wIS7UEecM7A3yR\n/ePTBK1UZT5VIhaub5Po4CyTv0z9M9V0IwAGDAPGeGjy7ZIf/4bCG4XvX+Mi\nSS0IFf/6spT+rpDWodZkoHwKkS3YdHPjtggyvQqNl0Hdh1iDDNBkr6m/UTRc\n2LRXEqKSnZwsk3qHXh9XVcFmqh7fQxlsdSJoIeNMwBZxq8a38mQFSNHrjXoH\nb0WGCoIJH3W18C2AErDv1veOWz48h9TSv5Y+PpD2RqY9rLJLA2bFMCzbZEFX\nOhOPqI4hCNM6WV9M1as8l3rPMVobHIUlEHdRHmKBbYPbtc1FsLSTxCH5b2Ot\nMZCAV8Qh3jVtOgSIifGikXmPMdqGmhfKK4gWMRXX6SkxV+jK4RBhNZRRHR+j\nn9N+CDaTI+EmSW794EKu7gRoxMc/tXZciNm/DkSKerzGPo2igsKQmNPZSKMA\nf/AfeJ/3KGev7UJdt+GWj+bj9tFzVuC1y8L9+B+ND8kD4byYLFTwpHHdYCC8\nByX4/MaH2jS06lmLK8gmEw+JqNRyEkEJ2PQoliLsX8cS6Q73u3IH3oHgVB6c\ne58HN4SglqPYImMLnCS+r6QhDdjZ7ad9tS2uRYRwFADefKFvOXK/PjiPoqIW\n1eYQ\r\n=n45+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"d06df8d8c006035ab63e4bc7b21460502327e061","scripts":{"test":"node test","build":"webpack --config webpack.config.js","build:doc":"typedoc --out \"doc/api reference\" --mode file --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"Dynamsoft BarcodeReader SDK for Javascript\"","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.15.0","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.0.4","typescript":"^3.6.2","@types/node":"^12.12.14","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","uglifyjs-webpack-plugin":"^2.2.0","ts-declaration-webpack-plugin":"^1.2.0","fork-ts-checker-webpack-plugin":"^1.5.0","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.3.0-v2_1581664156144_0.24169556708993434","host":"s3://npm-registry-packages"}},"7.3.0-v3":{"name":"dynamsoft-javascript-barcode","version":"7.3.0-v3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.3.0-v3","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"cf79f657ab1ab08c7e66bcb0b1626f41702d8b74","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.3.0-v3.tgz","fileCount":17,"integrity":"sha512-RPcjsZU1GZ7IwcG3BYTbGvpgDtWhQnM806ncE/3hneAAvynYnqYl/l/m3B4NiWegSjTQGjBgX5X5LzdRR4kq4Q==","signatures":[{"sig":"MEYCIQC8golDBEx04l7MujwVadOBMpuOPOOiOcF8oUq4pdzAIgIhAMdZahzdTccV0AdxAlSRtHhB/DA+V76p0QE/4KGaAUjA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12238777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehVGfCRA9TVsSAnZWagAAsMsQAIo9O6NvZLjQI82mUXIV\n2iabmhfKlmM6oKCjHKv7cxMslaD1yMthVmqcf2npPEs8oPPIbK0p47L3ChKT\nVgqGQKbltXhHd2xCyBs/GWn3l5dKTZqsRfUALpquMHQ8DtNnjtx99MR86tkg\nUG2bzkHE/p7UBYjYoNpUHpSaC7E6VHd9Qp9idN8og2XYvrjILLXmdkUDmIxq\n9YB/adqXcbcPeI/eNg8ONFZCvKiNQQyAYpo18OvXAxopYmdKJMTuTIAYZz7k\n+6FC3hIMCE62MUT81fYO2uQsPXGr55JkDoNpc3NlNwXPgIaVuKcp4P6yxvBO\nJV4lHopLTCLVqaDAzTKOCdjkZIrBkVI5tCZIawpZ0voe03PdDZ3Cda0cEJd2\nE0fAxQejdzx11lX/P6SitQ4/i4g4Zlmlt7mrZUNd45gqrgLXrnCOyUBwLDOy\nBJLZqLo3gPhnPGJ5iFjXm0t4Slv6fA12o+zU383d3jucO5LMwwrPgkAdV9u7\nZWKu2jHl4yD/PKqFCqkSuwG95nR8P9Vv+z/zVcTKIWR+yzKsc0mgGkBBD8nV\nbj1M7uCYlnskZ4Q8V0brNtAvoDR8n7DEHxnMV5BvqGRr2iS80Q7V62fYIimb\nJwTL2t6HKzkYvpZ32vhp6qECkPUVsTpJvLYS9oQH25WHcudzNVd8cz1Uc8av\nhyeQ\r\n=KtGD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"758dc719196733cd49f39f87300e40c0ec5f92e0","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.3.0-v3_1585795487302_0.935780922924512","host":"s3://npm-registry-packages"}},"7.3.0-v4":{"name":"dynamsoft-javascript-barcode","version":"7.3.0-v4","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.3.0-v4","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft-dbr/javascript-barcode/issues"},"dist":{"shasum":"d79be446986c0650a0e11a5e11b325fa870a7f79","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.3.0-v4.tgz","fileCount":18,"integrity":"sha512-O0AY1cTXnnde2GfDSqlHHnKKzURlPoCuWY7KDzR7lBYwk4vdL1mp+I5nHT10QPMLbgpMeZt4oanD0sYhkmGhhg==","signatures":[{"sig":"MEQCIF6h+QrTVGyZpSXpY6y2TfTeZdUibpx9rF/8P2twRAnaAiAh+P8g2BMnB5NxotToHY4KDE5o3L3ZcGaTmI2ygxaYOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12290729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehZvxCRA9TVsSAnZWagAAZYEP/05I/hsADexkh5YX2knK\n3ylTJ5wspO3O0u184dkrtSyg/1TAYu2HxVX7rzrKMHtjbkxLGEcoLLwTePgh\nncKHiC9TKZhZ0+VjclIh3AbKVS/Vivh58AujrZjUg0kiPzwY5eZGRgjG0z/b\njpB/LuYDhJI46pecFTOoZnTAFNykraruKQ3T0Y+uQmchxUgbHWM3HtDW57rG\n0gf7OPccvXo+XJc3ZRa2ICX8BgUIBnR9X+C8xy0KF3T61VwkC+Yx1gP6rIVi\nTzeXkr/H+rOo9Kyo1Y1h8qJcKaudWpfQPLsC5UDWZ3nvaiZqAuahutKx7ldU\ntbiJX9Cqmbe6/UcmQRMohwB7Viuhab1ujMTuCUZixVUg3LxY60rC5sOII/kE\nAO73H/qkVMR+4podYbadbmfZeEkB0B+j1AKbYBF2XU+5UZh/HDXjSHeA+ogE\nyuR8Q8B6D+K2EyeG94sx4DkNxu4NQ+2RtTI/dnZNl9Crrrr14m0Gp3XzUYt+\nfteHi7o+7Hqe7/4FwVvMDEqObM+6kkjxTzlGhCKs2alFwEoyR77rxVyZisaK\n+x8yZ2ceXPr8CBckIhU/P7UqcTn+1gWQ+hnFEtzGwPYIXyMRB+rmBOjjY4kd\nvgdhMUz9DNskgGqred3RVDQQQo7LpOQJbUEgFBpayupS9lZmu7hSXKi5byqX\nPoFl\r\n=bq05\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"1bff65808b93b8889fa2c2ad731c67c0ffeef9e0","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git://github.com/dynamsoft-dbr/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.3.0-v4_1585814512529_0.9776840405930425","host":"s3://npm-registry-packages"}},"7.4.0-v0":{"name":"dynamsoft-javascript-barcode","version":"7.4.0-v0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.4.0-v0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"1f2f282880b052e5ff96f69c86c8c108745787b6","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.4.0-v0.tgz","fileCount":17,"integrity":"sha512-bpIySrIqws0eDoI7vjELubtT3Dcuw/tpj296ZVrSCy4arW4FgTWmUvMGf+yyQPNgaZVaD6Bzsh6hsXmTpUenfg==","signatures":[{"sig":"MEQCIEcrAYt0K1rJh6gHkVRQLHAQ+INg0bqO/q4npXZioWt0AiBx6Mm+j2JzgFXCTJj/tLIElvlMqvAHiRMNZC+lkMF60Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13575047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeumtfCRA9TVsSAnZWagAAN3kP/0V/38i31+AyQT/TuAzx\n0oFpocNHQUQFQrGoLd2dUgGdi01NvVbW5dKV+uk8hEGhxRMAqzugi1ChOdOx\nDxEauvIPj9Q7eV9HJhdvrmbC8PftNL23r4ruotWFNfoDNJgKkbAtn6YFCEfe\nlrIXYj9CvLig4H0RrsuyU5TXx70M2rVPEsieQDDbe2RBCBI5MKIEWCFsTiCx\nrZMQCTcPvivgKNp0gMPca8ex9bf/zZWW0Gab5gcjLv0AIuK33Jq9xkSCLLot\n2hR3F5PjYu0aVAQfXvr6GzWPT1sb17LXLYd0IyYGaAHWguTKtBjsM6FJeP92\nuFz9Zx9TPjKaBNSY43TFTG9hGVdLoxBPBnaIQvwGY6EWMpCHvATN8EwDB07E\n8ZaOBSum4AhNgifbyFLBtT5ZdapwhUTQgboRgV6zd2W4sd9mVPLlP1opxX0J\nUs1A5lwFrDgAZqhLZTcnCkp5W+ZB+XT8QpgJ4dz912sWb87omH0Wo7yUwnN7\nT2bEgwx5HPWfEZVn47AEGoTXues8bV8NCFwoHnVFYZPWIrGy51mj8flQaOjb\nPXCNg5B1Uc+p9GO/cZi6lKC9K0uHzQ0zIjYVDmY5Ll3TmR7KVB2wghGfY2bK\nhhESsvEojOrxPjodwfjUC1Yja+s3fLOmLFcyqxKYXTKQz50XiHeHcRCAsGkz\nEogK\r\n=qKVE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"8c335f180f30e881c9a9449d95f8c0865a66f412","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.12.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.13.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.4.0-v0_1589275486126_0.49620726486918354","host":"s3://npm-registry-packages"}},"7.4.0-v1":{"name":"dynamsoft-javascript-barcode","version":"7.4.0-v1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.4.0-v1","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"22089a4afb2b94466d1698005559a254bea74d53","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.4.0-v1.tgz","fileCount":17,"integrity":"sha512-yNcCbtcXY919g5ggLj8OBx6KQhApFeoNXI/jYV+X7w1gfKxsCoOqBWAq5UgfpqvBiUW1aYMaU5dj3bHhGGB1QA==","signatures":[{"sig":"MEQCIDkrLIp/m2vN6VEOJpZpAkHppg9tzCwf4R4cZYmi6p90AiA7LPPyw69ZmNQ6fS3TSMNK6GP92jyjvqcjTgSnk7TtiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13307753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewkiQCRA9TVsSAnZWagAAiWQP+gJpximB7F1BdZbJjRCW\nT2UYaC+smFo2amSkX4EEM82A/8WZ+nAgqo6juYURymSdMnN+ZgZ9eMB85prB\nEPesmLJeMl5HJa1Eg++xX0bp7jQdbTpmeoV6U24YKrUq1lAYLEFKWpxgoZ+w\nPAUQAZwe7AhjDn5qC4jsdXjCxlJATtZBizMSovOIsi73pz/drcV14fZmLpmo\n9TKA1Kv90MS5hkFDye96dPv/9r7JaulbuLuf+U1p1Fp2TK2pJv/vvDNRFTU+\nsqNCJNfNEejdEf33/qKmhhfhkHCSPK2W4F2CvzFWSxPECl2HkGKZshv72Tay\nRQF8u8M+020aJ12ReVJ7a7MTPL0/TK3VfI7FLymsDsWUW9sWLdbgjlz9iocj\n7j+Iz9FcEPij3bg2U0lbJz8nUO2sRdyt4x3H+u3dFyC6IyAxxbDqK04M7C6U\nhsCTNemOQYJVxNpwiU7wlFDaFcIuCoamlv4zSRfFcFy/wKTMGQWBaUzp2AM8\nLOENTePnCCzieDx+IyJp6RkJI52XgCKllgC0+tFYabTJZlBwvXTxXUNmwbAh\nVMraHBw9fcn+B+p+x6C/lm2ynY7lUv6u4Y6g047f+wyQ2ijRvoSkQruMPFY3\nAWensDw2qmIXWmOY4vclPSuXQzHnzlZm/MDF5pl+25VR6FTc7m+8lvCXxbgg\ngSzr\r\n=jEpg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"bd8761552059350414142f5a379159707a29cecb","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.4.0-v1_1589790863370_0.2129091825102496","host":"s3://npm-registry-packages"}},"7.5.0-v0":{"name":"dynamsoft-javascript-barcode","version":"7.5.0-v0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.5.0-v0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"6161222e5bb76fb403600371099952b0cd4213a5","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.5.0-v0.tgz","fileCount":17,"integrity":"sha512-yYyI+Dc009zJjTZvOA7Vp0ETTPyJEfQ565t7ZypH+DqFW72GJxOciRVb1dxCEhRG/0EYzZDm9jfu9MY8zh5Bpg==","signatures":[{"sig":"MEQCIEgV/N2gW6GpYgZ1XToJqwGP23HObrhHDTqzn6ZqZR2VAiAld63gxnJDW/w+BxwMtqNfr9rNsDWEk8U4TogmiERpdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13336709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJ6QbCRA9TVsSAnZWagAAFkAP/1qtGWVvOMmntB9cyTNM\n8KZG5QDGC2vJ+O2PZxsQ5YQX+LPeJnN7IfKnIxMKTaBAmWqf1oM8cUMLrJjD\n7rpGo84CPuAld1eR/Rmhpe7H7fV/nxRwW+guGsgiwllHawQBfMc6AWTwYrn2\nKy5IuCVPNtJJJ/0Ca6eALAqp443gmjTa+ci2186T+tukWTXTF+7C6LtUUqmr\npf5qHHOfsqvfkSoitvREpA0zA02PLFXRDWYaIgiLT0rOeSQKfrRNpp9mMGRD\nsdYjxUc/dYtC6pItB+5SeX1RrUMTRXGDUhKoeNAH4vjOsTC8ddsuNdX1XDkm\nPumV41a5QPIi7b3HvG63U87dF7Um0K0YND0SQG4pIn2IHwmFVvtgMgN+27Aq\nxVZQv2O+uW/0+XNInvGVOL9iGsIeBCo4e7nlpWvC4qlUP8ro+IVgHaFyE1wN\ndGwpNIcMVDP0zRtYaXtJu7PW4kpgOmOo9AKmFgTXBmuJAYE9mIMoNL13m3rf\np8Rpaf2xJr47o3sAxOw+HmwG8PlU1rNXPMfkZT2TkbgzegUS5uqk+RLSW393\nu606zWOk3mTr3J3TqtCq0Hgd04PfudqeGQWoOO3B1H7qVBuC6GlDULbB1GbG\nnpVr38cyFAKMN/XLYUssZb0AeWf7Qu+ugV566WUqkhrTjJr7a/QKc0LWPHzX\nqaPg\r\n=TN6O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"6cbcdae03ec6d3a7e53f9921afac02d6157764b3","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.5.0-v0_1596433435012_0.8686949640230204","host":"s3://npm-registry-packages"}},"7.5.0-v1":{"name":"dynamsoft-javascript-barcode","version":"7.5.0-v1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.5.0-v1","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"99b25a2578cfc349023caa3e1cd226485769470a","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.5.0-v1.tgz","fileCount":17,"integrity":"sha512-2HCVBRIixVkZMuRN7Pmvg5vTO2h6OQ7ebC+2cgETAwPzwAC3Jr53i2IPfQs65/N96HKeEj/EY52hCNJyOu5SsQ==","signatures":[{"sig":"MEQCIEKz9p+L4pd1rU86BXvhscvQdMe/3hvlGEcJoB2aC9Z/AiBNm2f+5edLihbBnxe9JIswTsqXpAA5DyPa3/5N4RnhDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13827552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJ8NLCRA9TVsSAnZWagAAhH4QAKDhSTEbA1+VxPI4Bj9s\nVakJ5tJaRcogIZWwHofVKvk9gXGy7ZrtmHFKb3oPKFRGuZTDioo5bSQl4haY\nQplQqz0vkYdwvsGlN18rjfukEK6feaanuype9t5SE1N9z2c3RTnxSefj3/ek\nLFuDNRfeLSmOjFaE8lILEzVhce+/FoonwfNEx9XcRrBCoQ37lIXiHA9ddGh6\nxVEBgIfzz4sh1IVphV6bWpwG0PHQN6fzlu+Ez9ofwuO2HDaVr8i89n41i1Vq\niVZm70rZ5ply6SNJZsyzoHCW/Qre8FxYqEc06HoA75ek6Y9JDc4aIKv2JT5W\njcyd781ca5t5+ioRZoEv2aNbZuFzVyXxgKK1NLYSipGHRV1ZQJ6tkexRbOM0\nqN6ZkEQXBRkcm6jloKOXoTYOfwlOoluACyTq1n4UK77V3FOz5qWCISr28yjE\nSrPmcZ8DeZe3VkwNEVeCVoE6ffjoEjoCxPuJyl+Osa8REw7bvUE0v+ExHiUE\nxcvnX6YjmAIB35rpzQ8JXXCBVgLzt/25GKDidpa+js2mlui5Lfp3WkOesXss\n2OFTNbxhcsZGBTmnBjhrWx8tgxm2Z/uu6JyW2mWZ3XSqxFxyIgCRXmMBqw2n\nKMJsusM2hWjq9Foee6UOhgMC9MwRI8rSVPA1r4hIdXB5WTU8+cJnnlUGVLhX\nGKBT\r\n=zTnY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"e0c125b99974f0a425c4753490cc502214f48f5b","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.5.0-v1_1596441418791_0.8581340968135376","host":"s3://npm-registry-packages"}},"7.6.0":{"name":"dynamsoft-javascript-barcode","version":"7.6.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@7.6.0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"429af91fbe75f1c1acd33b3e861b45465b1d9bed","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-7.6.0.tgz","fileCount":17,"integrity":"sha512-vpTmxJGQ8kVGEoioc31l1ve9833+BfqtnZP6wqGB/TjS7sVpjIFvCi8VMJCJmHjCrVJwarhY8M+AwBYELZFyNw==","signatures":[{"sig":"MEQCIFOsgQgGQoQ+p2yx03aQNgws9a4wbc4upc5mGDjW8A+SAiAZW3Rt3WnQF9UR7QLZ9UmookFhP4vlq2mg0iciI60Idg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14008739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTd5MCRA9TVsSAnZWagAAYHEP/0yqaZvN60cF/1nkHEM8\nieyXWnkBzZHXTfLsBzckjizDZ99dXVS7t7eA308hIjcbST0PjvMeyPdixw5G\nRmYwyPjrTLnzbl4kSr6Bt9+GDnTWWtsFWJQsd72ucrKrgD9yi3KxQf6Q/nIC\njBabYCQuIXIfqb9qujKiQMol9EJ6FZ7YxcJiv5uZdvhjmA4tuabS3jwmt/Fl\ncHsD9Yafc3C3grfM0W/OYFKCDpuz9BlXstf00+Jmifg+iv0BPdx4B0GQPBa8\nOS2TJPDIeZ3ojHAaCcugb7MkxcMfrG5t+t54q3A91AIVXnXeloca4JCal3Qy\nd7szX1LQjJXh58RarSygEvhh04wElVcEjpo+l0xMD7MlHJQsOFIH4Q7TiYYB\nIGz5t8+mQS/z26OcJTuEVfpfywOVrK3cTS/YaRIYMdiqYNM389PNIkxUBs2W\n9nViS95dFhyXaaH8hB7lJ8tG8y3/vhUyFKs1aYxr0+0xq8e1eHFAS9bIcHIb\nuzZnI/qjWtLDMkqxAmjeQbwYxK+xptuVgMOn3AL+TlHTY/NxsrDfcBaK5UrB\nbh2q9NioALmiwOOxr3sr9lHRsrT6FKJOEGLpI99EQZ8u09WRNgv377kipH+g\nvUQsjNZPr85aLRZsfcNqXKMYsaGx5rA0z35hOsQhSLOB86gZnl1zWtonUUcl\neyRT\r\n=frDY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"d45914cdfda7d931545ccf846a3a08d3ead8b398","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_7.6.0_1598938699473_0.6664492575166925","host":"s3://npm-registry-packages"}},"8.0.0":{"name":"dynamsoft-javascript-barcode","version":"8.0.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.0.0","maintainers":[{"name":"rachelj","email":"rachel@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"6b1d21650b543ea89b51fe92589c8f0bbd003d57","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.0.0.tgz","fileCount":17,"integrity":"sha512-lZ9WSb4LSvD/55P1V2pjHqA0rDVxqr4MQzI1weWkZBazxNlahubuI0Y2OTc/E1H4of0o7vU3ZjB5OfnwHSOj9w==","signatures":[{"sig":"MEYCIQDd7VlVoHX94oFml7h+apj+1bIkiAi8wLQMDxf/UeZd2gIhAJQE0quY9FKTz0WkMqKf5xm9zy8ZG+MkR6MJNf2QpLtE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12910316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgxMCRA9TVsSAnZWagAA60gP/AgPGDmb7cV377vbEnGK\n2JNB4D4UWk8SKMRLMkxutMXZQZBklCTiCrR9DJ013ilO9akVkCEDFBbogGYB\nZlZx83Dl6fv34TkWHo1YIvzD20vEnbSi0sa5FAe9JVTKV4nx6x1HKtRsObh0\nq+Hikd2ZC184NRi82rXCTmvt+ZwENw3uAX6FC7hr63yXSXVuOuTTO3fdPrwH\nHNuXfyD5A2GHbKw5hMVybS3QPfDkWxo6cWqGxGQgf/J+7Vno7tcDnkfXfnz/\nEXd8Yo95I6kUYpd6MMNKyVstwpr67FQ5Bab60tETOuh70S1KZo2TmESbsqXk\nhvw5zC9Df2v0pZ0KCFFgv/Gea2djU27R8tlqhMDP3X0z8hy2gWD+MNgTujig\nGiuwrB61y69T44/8fdCf8ZiMPG+tvM+tpB+dBo2/sF7XlepRWx6sQisKIuP2\njEx4ssXaH7QZMWAlPywoaSspeBiQhhlK6z81FkOXyY0cNNDRML487D1jmQ//\nvyo47Ks9DhI/uNI4fyNeVAuhHYloN2i8t0TWu0lBliK0KajDWlYL/qDEwkOQ\naGfEqjF2P3u5Obn9NwFOWDhsXJPRqHtdPgLOYLGSG6RdqFrPcSWwcRLD+TNk\n7jiEiy6BCVHpwqoaE5cFKc4jlaedP0pbpDcKhAN9ATAGCpfrbzO6xG9zLQ8F\nXYt4\r\n=T5jk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"7ec46e40e3023acc63900d401a20b0fa8e3fd5c3","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.0.0_1606290508258_0.00669402041745748","host":"s3://npm-registry-packages"}},"8.1.0":{"name":"dynamsoft-javascript-barcode","version":"8.1.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.1.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"3e4febef96409592881c20b3a5619afaab684ced","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.1.0.tgz","fileCount":17,"integrity":"sha512-30/twu6rBOmHCtE5MZaBkyDydt0rZCNIstGXvKByzCklv9mHWBbhVt1la/BMPxClWB1qJXyUkU4hvZwwKOd6dg==","signatures":[{"sig":"MEYCIQCoY4PyCUPJiPemKEY7V+Brfo5s8D68cYBRJ7CMO9j6iQIhAMa619CZ/SzPrxAybh98e89pHFZksnE84UIYQzrkVmZW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13159882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBocKCRA9TVsSAnZWagAAxN0P/3EnAhWpsDN2nv94Ljve\nq6d+ZdepCYCTMuNXlMvOLDhSIHUmGE/lCvTXCcaugk7LhFc0Ncs14lZr+/Io\nKVbUeh8JWYPewsqcdAH6pT2SN1eX/llH+bQsarzK0Ek6dWfQ3clZ4VZ91VBD\n0fjPF19j9ajjFAGE8jobbzXBkDnfRTvlXQNYaq4kgLpcBUod4WP4uugQmAEd\ngeca8gA9P95IsPwsFOgg6X5qMfA79GPGzwnC3tMRO3xM3zKjVrMijw9XH53K\nbpAigBrSe+KJAjQEP7n1NGiNVN2m+pg30hN83TekW+G9g2j1JHxsgHYmIjy8\nsd25UbVBHob7S1bWqFslHomyzUsYZ1yj8ElSrlJ83qScWqRzhzwDCwNW4mOC\n9j1rEAguFxeLIDjo84cIMwEfRVc8yPhmKdBPm9vpmnS32ZZv+yICd3mWjOSo\nHNUdUXv067JsN90c7316Qm510GGxXNIyqdNEzC3jEl2TJxLBfo8ef4e8XJdY\nxEbeLeHK/ELtqLm+KGImXC12pKG1KD7yvGxoBcouM/iPP61kzWl6cfE4kbjh\n5loOmL9NpUq5LQ/0+JDblxyaXmrhHXW82JTUCEKIgxT7r8t6LsQGwikeiwPW\nNspmY3Y3VM4FFrTf/Q28IXL/eOsyTqJpdxNCRFjANWIIF0mHMWTQ4n5TTU1H\nOddD\r\n=ktXb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"f31afffeef0e50d4e3e1804a0316cf993b79207b","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.1.0_1611040522375_0.31858025609616636","host":"s3://npm-registry-packages"}},"8.1.2":{"name":"dynamsoft-javascript-barcode","version":"8.1.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.1.2","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"f2c13445a725fed4809a334e8a3a518eb2930d94","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.1.2.tgz","fileCount":17,"integrity":"sha512-2Uy4pcaBK/UONZJAROHYJsWExgSwU0OZfYaWRUa0OAjDhZBZyzWKozMikiOK1zlhJRk/8TJwkKhnWFpFrwwQhw==","signatures":[{"sig":"MEUCIQD+Kr/0HerikBNQrZ1nJRlaJc2N/MfF/ggXYcJbkBC0RgIgZUYwNmIBHomLSwSjQq/NojV8tU/6+9UN1J9rxaApe2s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13166604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCoeUCRA9TVsSAnZWagAAhPwP/0KZComGcUR8QdIS8a4F\nekWfobQNRBv8JXMLdcXGMTot/plktiQMb4QDvmqJw+yYoMdPt7vv6MzWZv/j\nd3E2vwISSJ9oGDO54Fig9xv9RIPgkrJ2rTgrlovrtOeKmJwuQPld5cX50BKa\n+dBbaAlPx2foj+lFR37KZBrJqOuPxRmd9zOIbzaA0srJeSe7R0r3QotjHn2y\n2njGC+SVcJkA32wh0P5iOO4sF1T5RwidFTBnCl3j3tWA35oYTCdrjBpV+WzN\nIzIHjgxpdK6zNcsStxzKA72jmzzlTFtHXu5iqMxaGwCcCYtke0nf+5xqB9Ru\nSf7wcIZRkvbDeeX5nmWqf+HJyHDaeFgtBcjBq0+Z+gn7UXW84omB47E+FiyI\nP1OoIntyDRkPGd68PWCSLIw7hpWipkfoup9+81Sw6lm3DMLhyafz0pHGPuY1\n2dwwoXDNW1DHonNddK2GD9uxmEy2s6HlZ9a4mxuxXttK11KvFvRgb5WE4zD8\nZ7g9CDgseWeruz2UAeFNMpAkcoXMLIpIc3JYEzuKEkfnyGRSN1nRTk3u+wdm\nqUhEhhhh1vTiMwRP2BolpyCdnt/ETTiRjf9YNeaQvzlVLm4QdJFhTVPgAfS2\nUCeM7DFbQdFvctM34Jlhwf+WCb5eg+QeGGZIDcN01whcXrX+eTZr4+BnBVAH\nr04C\r\n=rIfP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"36deac1fc9b9bdd30062a7ae2ce7013ef6f154e6","scripts":{"test":"node test","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.1.2_1611302804104_0.1948504675732643","host":"s3://npm-registry-packages"}},"8.1.3":{"name":"dynamsoft-javascript-barcode","version":"8.1.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.1.3","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"ba2b100cb4258c08483c7d98ac564c8811d658b3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.1.3.tgz","fileCount":17,"integrity":"sha512-dQVnw6OwrXiF6cBU1WFVJXJOgfl1Fs+brhlsfHgdlqilFk+6Mp+BnZsI0xDAckWpLuovZJlIiuwwSTO/nWCXBA==","signatures":[{"sig":"MEYCIQDNLJJdtyDTO3loLcbTZoAYYT/XZPVKbBktQyQjVywvXAIhAMTAPR5PpW/XDbfOLnu4IBU05Kw7KqZtz/u7JQ6x3Mi3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13080467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQJgJCRA9TVsSAnZWagAAiPcP/iBC/aN3Xi3srkCFqrUg\n4+S3YFiRdyb1Ic7hoqOvabGxX9hGNXE5Uo+T9adfmDwpB5C4p39EqKDjq7KF\nAnP3Il4ZF0y8E1cxOfsdiJlvwWL/WC1p6097kkGE6bwxEEJT4m8tIbGjsAv3\nBQUEcah7m54P5u1t5TuUnHDMDQKwBMAT2cIADe7TgXVVIPWkVSdu1CaKWGpf\nlMzVi9ct2J3zz8gQvkMVNIN/bKXv4M1CAvI2nZFo7jjuT/9r66Mu6sEvbg4v\np6PWGS1eqkcFrKiqX3k4DTBi0y2PgTDMeNhuf4hQYhjiyWVil1FiY1JiFuHb\nvQ8WUz3UBiS7xmSn4N+hFOJOM4JUZbEsiRo25AbGVDOM2adnEA0qG4Apzky1\nx2oZoOXvIrthh/iM4oJ3Ovkh5CvALWN2FEiRH1EorCCIT1VWS8D7OYNaK123\n3xSQNguX7DCsbsCs2gTC65y/JSgdp3HHm7mITtb3w+QvmRpbKGogNbunNpp2\nG6rNtBttSrmQEzt97FoAuMM+gHA9DQQdtnPyFVxWFfrbx8s2LAf7g5V3rXsd\nzLT4gqBxgxDO5zxDZa9x8AM2nRkHryj+SpS87if7BmA3FtqAenexZtHgxIx3\n+GCngwo70Uypn62ahCF58tAcZdKu6Kxswxdv8BDLeVoJWz1S8fb+kURA6R8C\nd4ED\r\n=vlLC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"95919a8b3104dbfe9f2073571ace0c19c58deede","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.1.3_1614845960721_0.974177441811426","host":"s3://npm-registry-packages"}},"8.2.0":{"name":"dynamsoft-javascript-barcode","version":"8.2.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"5e83b693f66121dc2ac74b48718bfbdda94b1f8d","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.0.tgz","fileCount":18,"integrity":"sha512-3AInirKDAw7CkFJF3pqpHZz9+EfpPQfrXbhuko47zw/U4tAJuDO5gtNB66/ZAZf9KmffDDXo7PT2S8SVX275+A==","signatures":[{"sig":"MEYCIQDG/12RiFnfSIcjHhDJqTQtxStvrig0jg6XRJM7hQNTdAIhAK5DsUuIEn4wIX19+ubhL9mTgn/4x5LHQeqeHMmMjvjf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13263731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUcPGCRA9TVsSAnZWagAASv8P/1C0+KAieMZVh++y20p5\ntEnFE4gVzilbnqkjdLfJAtOVGLr/n1+3JZevMwVQQa2Mos92L0X+sVnbRvBn\nGcSrwPDpCVvt5qw2ygoCoqeVvpQkZCE5j0uT8VpUZUya8McshpnwiqN8bLxF\nq987IYIYVd7J+ucRprM9vfYX1E61Uh51KiOY5QLI/AcjEChuzyH5YHw+ozgW\nkRR7fNMq/yC2/7MN/GfFcSkuc22pQHbNRc1YM8IHb28vA+XRJJmd/Svj3sH6\nU+uFpNBYHiuaCrUmeoBFOsSDyUtmRkEBmBjpGS2iNSPu/lvrwjCKuu+pWIdK\n5WgdbLxhw+pVK58DQgEmgWLi9i9sxuJ7lsY2Qi6NKr/tDWf88SJi7qJa4rry\ncTNWO/+CKwX8Ta2Cd3wmE4AbxOJpgwv8QDZYiQ13MADsYKmDpkmco2LbFl1V\nPFKeQe+04KMA2ourDlKhOTNfetUFhBzhwudOKFE2RNNS/wOtkczyYTx0trwY\nzPEnIze9kGVOcAhc7n/wRDg2T1ciuNwFoRkurmY2N0fFRGxKz8pSQhQuWn6A\nem2HjAXmRZvLjgeAzPcU+jUhxmcv0fBIjUajLxAqFh0khlqLBQcxA9+/qUTd\n9dalvPKY2pjujdnKtmLOV8Ow7eSHscRJCrV3lSdF87BaGmOOGqUM5kz3/yHG\nXmdU\r\n=HD9h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"cdc289e83a8ed5cba24a749e93c0b427efed4712","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.0_1615971269304_0.7317129650101102","host":"s3://npm-registry-packages"}},"8.2.1":{"name":"dynamsoft-javascript-barcode","version":"8.2.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"ed2a85235d3b30cefbd433a4869ae1b73195d3af","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.1.tgz","fileCount":18,"integrity":"sha512-1pdnZMQzx4KawVAHocniKiaP08an1A7L3lB8eVARydNHeCgDSb9QGNHEbN4XEQ7LtduGWi0jmFGxjIFZRSlJqw==","signatures":[{"sig":"MEUCIBydwHyAYeyD1Pnjy1R3XlLNqHiI3s9CEsFj/nPUPaorAiEA9Pbc/XAJyJiDGhCiAqkiRwDR7vEnDu9dTceQeIJa0wI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13263625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYYChCRA9TVsSAnZWagAA+FQP/2k53E/t+KhfN/RZiT0G\n4g9u5Qh+ZWJ7b2GGeytzxPOHOdt4KEkUJgJPQB30ng5AF6a7zM/D2lhWqAqd\nGCMA9+aPSpozBv4aHr34ubQYZzqXdXnf2IRFbcgMWPFZ8lyDgir3gyeRo3cF\nO3iwlhHdbuK73JYe8Cj6ylunbmyfBQOSAIZ7/Qc7Bf6G6m/sRzn+jbGgm0HU\nYo7j8s0Srkt3KU6zcUQ93eSIFhuzw3kz8H0yiw3EzCcNquRMMsuTC0OieD5/\nDTA3oBCF9xGVxWbNjCDzLbgiiHa3mE3plisGBZOpkqEoJezlUKpWQzeKevRx\nv/FLdN2zJ3aY5CwxQx4zCNA84JshjhesI9NHKpXaFIbeO/OX8vRzH85MRvFk\nvEFAtTKGQ2mxeJuBLg7oS9YRK8sW7XbMQQJuS68bGoVesrBUUKArYtFMjiEh\nvCewMAbl5HgPc7H5Fsa2MJioEvMhp74o9I6u1ag3BMZgJSuPCdPub41eAjmq\ngRouo6LA2qUyZnwA9BIztSMxUq2dWQlu/zg1R32t6HvFPOpTBQPuH/qDDuQi\nFcmTCeWc22pLPx3GVjlJHB0NKsfuAk43IeLxCmNF7bPvsu+69iMSFyRPL8Gd\nWlV3CuqtmLG51+mjIQ6V1T5igL4wv0tp6AOi6x70yKH/PXblWyfjVKrPgJ4f\n1JNi\r\n=qde2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"93f667d3254060d5c414d4321b9fb4fe4267ed99","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.13.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"12.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.1_1617002656925_0.2761315616055824","host":"s3://npm-registry-packages"}},"8.2.3":{"name":"dynamsoft-javascript-barcode","version":"8.2.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.3","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript/","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"dff00e279a8016ae2d18ebdffa89e360329df9d8","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.3.tgz","fileCount":18,"integrity":"sha512-JtepRiVwdHAP8s7dBQKcHcmTcYGl+O5hAP+1uZt943B2M8f3toF+bhHLszfpM37mQaWJYZjATOcssZLYMXNFJQ==","signatures":[{"sig":"MEQCIFUvEmRuW6qD1Ixldo+SG/3zvA+HgpHFJJeaH4N2LKlVAiALyVIMkJzZwzAFPajv1nYPGEOSdPK2/I5LrF83xoWnZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12070633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd8nKCRA9TVsSAnZWagAA4+8P/3AMTX9ZdsFmuT/pn3xW\nLz8YRObnu6jkThFyXG1rxUFpZTU0P5AUiWZ+uw+k7xhq9u8Us7C6wY4HzJmF\nLeopeHT9WxLKrP78D13Wnk7PK3eaeKtMYeQ8xMjZuRaiRrLQm3TucQRu0He+\ns46kGIU6oS6oOleEYPwin7/mYTCZfHlYUCPoegpcSCpm1g9gAc2y8ar5aBId\niZzq4xyHBELrIa/ufFWW9EboplRs3UL7pPRQ5NdsUax6RI9jI09U/wRiciDH\n1c4hDeywENPb++qE9xSgA7jNstLCSAbazn5tDwIIN6PsuAyxcW+iATcNuNKP\nYl0KYiGJQWnFhSsvQM6nTanMfqc+p907qfEjGOj1ty48jBSIe6+ETM8lX9Sd\nsQGMjEv3BvK6UhfEfwZnEgHtPT+VMGLDBm1mxfRb7MY/dXf1BLjf3CX48mdW\ndjViOB3rRY2HjbW4D0SsP40DDMz8tNvzZ5Kvih8UaphmXCPq5KTOJrXpPA7h\n2jTB5l5wziO1HCdHnVpW06Bzeopw1BajU/NxmFogxVMO8enuAB8AzalphqpI\nQBTp3AkwF59DbWeD9stBqXiYN5UzOam/D9meOweKYbNMPvZIM0Cjiwj27OVn\nJtZ2YyekDAE5keJsBIDc5E5+fhfkJBplIRWXVg3o0DHdZ2JTa6WOVE7Pq9Gk\n6qeK\r\n=kDAc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"dea60fca941dd7ca648b77bcb30a4e94043a0fb0","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"14.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.3_1618463177902_0.6011789482164867","host":"s3://npm-registry-packages"}},"8.2.5":{"name":"dynamsoft-javascript-barcode","version":"8.2.5","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.5","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript/","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"43006db0bf362a9d0142e5785e94c1a3e963ee01","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.5.tgz","fileCount":19,"integrity":"sha512-aMBS88Gb1AqZ6LHux7Cwej8q/qj6BsDVS8UtFC32rdDUXzhHmI/9XNJbodpmWLxXS3VvYrANj5XDnYDIe4jNeQ==","signatures":[{"sig":"MEQCIEdTx/wbh3gaaF9u7jSvUyizUXP5S8HxCr+36+0ETnCnAiBemQ3D+xWo0Hq6/MzxKUQgdq+KyIsEf76qP/Xi1nxowA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11263490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoy7yCRA9TVsSAnZWagAARwIP+wQloBk8a8yhwE2RrQm/\nmxQyqKbZQvuINR5ZXrJu8DFa4wDmSMFg0CSy88/gaDixvwQkulsTGHmbKpH2\nazzmw3n82pBunY4Cy64kIngs0euP6nht5INqFq6TPVukFYzaVqQitDB0W2tp\nMJ5kMujMLWYRrP1REsjf5SGXV+PZZyucVXQrONFNWE6FIEvx/3+GRiFnb8c6\nCaq+u3LQmPHDU+ow+ha2jzskwqeVsk88H6O1iuRBy/5LIQaidNFBeIeOJ7X4\nP983SU9wyVIY4bygPnYx9U31G+8eAv88OOFr6gvUyqVdvFm2UFJ7T8DJrWAo\n6ML+a7Duhil+1u4vlXFsfLLIgE4owrp2a7kH1mEC7v916YmY2l9Cmz2ABbA3\nB9CtLvI6FmcY6W1nzdEpTurDIo45BEHiIWeSQJGRefhVmx+ZXotIKsX1Owcc\nAtaKIlAzJiOb57LPi21n61phQJY52Pm9via8cc1lh+O3LyGRom5TWFY1E6pV\n2IC0EU5mCvrnpCsUfUCNdakP7fO/gkXf2/AhqamHR8NNsp8JPnC2+bHQNoRi\nrJJnYMFFSQtptLeCeSPOculs16JHvxyeiYVd4pRmo8gaqe0VakN7rTQ3QRzr\nO6slOD03a2Gzm782jFK4NdTaZDxH5hT6iD8UFOi0kQFpGDw5V3WpOkEtUM+v\nmDIU\r\n=vCTs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"20951538684fb2e9afe8b91bb0b883ff7dce33c1","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.5_1621307120850_0.7590349204795186","host":"s3://npm-registry-packages"}},"8.2.7":{"name":"dynamsoft-javascript-barcode","version":"8.2.7","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.7","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript/","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"b43a52246f2549aad329440c5e4431ca87834323","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.7.tgz","fileCount":19,"integrity":"sha512-q7IvOoGSO4dsx9Gb0zYq5D6TFo1tXHojhL/L6jeJ6Wb6+LSKebxZK48JBMgcy4yxxWUCkW1sr5tvAzLJ68w4DA==","signatures":[{"sig":"MEYCIQCAl/U2CroPd/KxUJz1XLETzxXFrmpv+aZHgjwRPI0I2AIhAJxD0Q/JtTDIvMaRAPDEa/uwmRjS9JpgRXiSwC4QOx5k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11258618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvw53CRA9TVsSAnZWagAAucUP/3SaeLopO7lTLvLdLHqE\nejpU5e+XH9suip3NooWTear6RgmEQ66fGRhAOtmKoInFuXVI7wHJVBxWBaFg\nipVDJ7D14+6zSZ73EccTimJyq1hYQarg0CKFD63+6STqae6vRk7FPxwbipC0\nsSO+5arZ+LutVEj4K19w+6NDETdULguzj0GJq1I2L/YqDlLSzCkVv0krV3cZ\nIvg2JrI1645HnhUoaLjSgtnYIpiEDnAl8vickIKlFhZMGufU7yTTyvvysLYN\nEDI2mteTbQWcc7RNlfXRUak2uNBkqWEzZeOn2JWGJABxvUo+c8RKlE6Q92ks\nwYIJd4Xb6YI6tGw5BkuhWh6gsJclDz1E3a1WsXphyBVQqsw39qNAJTqtx49T\nF2fEj7gn/FYtJ9YCKPAiOEuBTObfOt3jO+x6kgfP3bC58Yz9aAzBdS8V5rPO\nvO4849wR1pxJKzxNNN22pqYdY5SIefPm8vyfZd2eF2/m41su673VIBzNdiUA\n0SMB5JgM1JzVptLyMkL/LiJfngolrDCRrylR+I+yi6+pfhjwEntxP5aER7Oz\nmS7UZHLBuQuIn5A5VR/HL8cJ6ttti4HUfR5epMU2C/x+l56m6nIQM2pbNtp8\n2U6qJ0bhg3DjTF0e8GGw16ce37hSDQDQBIDuS7Z+FVVg8Ga62DNvBlRyWYB2\n28Ow\r\n=YpZm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"14.16.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.7_1623133815215_0.45585352898037","host":"s3://npm-registry-packages"}},"8.2.9":{"name":"dynamsoft-javascript-barcode","version":"8.2.9","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.9","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript/","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"1d3ae7423d4e7034d52e56545df98501432de937","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.9.tgz","fileCount":19,"integrity":"sha512-/vNP3LYEz5CWEoS42Xu3BXei55XmFC6Z8L0PwPeECMK5is90pQ6SYMH+lhROxmGglrkFUOZW10hXRFdSUuTc/w==","signatures":[{"sig":"MEQCIEAK1HPtNTC70svTNvfvKBiQ/Ji+En/v/QgYRGMsQB7HAiBPZKwao/ZgfrjzPnFjHaEZlNsDjl6gDpw86k3hmBf5xA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11259512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvyMbCRA9TVsSAnZWagAAzswP/jaT8LHqEQgylrvH3DrI\n2z9H8pfkgdIC4YVsMgI7+gmJAjGrmqrgfJuDJeo2GbswtT5uo5irqZD6h8De\nUq8+teGls4uNZZW3CayQJth079VqrCEVcqUiKiMEkzl98J0kjhB68uTnPA01\n4oYWL/iOUNy5+GRqZLcoB6D355ghxA2VyAdln0I1DjL+AhTK9+9KaxPZ64xt\nysRDd3OaQZ5ryfehH6wq4KjFUpgjwwiTkR+bXKiF2cTkfASNPZq2a8yczG0S\nDWbNgWgxFWOHmVmMucfUlnOp5+fPAKy4WZKSglfpjmMRKfVfwYfKP8ZhruJm\ngMFsUpOlWEIzj9y2nde5AKlmqMhhajIG6SFZZlgfF3rrc1gUOGIlEBSpcXhq\n4TjtttOEC7m63fvRbAFtmzGn7QOGq1Z7byYloFxms+4eXyC2wSun9inhwGf6\nH9NReZf9R2GDwdu+Iv2t/ltsYX6v/q6wQAlFqB2XZlu0R5hdyBMn/pfXr7BP\nAME58S4J2Ez4O3IxRhRNHLVi1C8WIrsV+JOy9tyNBlAPd74cjljTHd80cndf\nIm+6KRTozXhvvc821LbIFZdQuoQcjKy2jPRV/1eMAte9BzcFsNiXHfme/7Ai\nNI8nioOUN4bxcwwEgVgBlyV1vdJv+O8gS0KOefbqxlBp27bKgiRAdKrZgEuM\neSbS\r\n=imFC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"14.16.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.9_1623139098859_0.6650113448012025","host":"s3://npm-registry-packages"}},"8.2.11":{"name":"dynamsoft-javascript-barcode","version":"8.2.11","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.2.11","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript/","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"2a8dd30ca0795f41d88f166dae8782b44c1dc1e8","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.2.11.tgz","fileCount":19,"integrity":"sha512-TOlJ4A6Ei17y+JVpbiJIFscmhF7fKUNZaZDBZCh+StakBvVXcEaKA/RXhv5QPu8/nAJzLGWhSxm2k3Oqcjukmg==","signatures":[{"sig":"MEUCIQDw9ClyDZagOWDN59Du4/EeuIyV5eI48r1zoGdxviCUUwIgMW8gEq65uqCRhhhNzWozBk2c9oqGwPRNj2cL2H7lijc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11259228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvyPFCRA9TVsSAnZWagAACHcP/24oQ0RC3+uGdbkizqpr\nrLmfhxe/LX8LNpESxyuCm6HQXec1kz2snWXykSvJ35bNqgh+5AzHq/LMUz3s\nSrQL+TY2ogvre3VqGdVoJjO1JMH1RSmiZA7WCDKdOOKeAojpT0JeUmeKM8O5\n8H0Fa0JA2yCkq24Y6y/4m6xqGWU6dMqxhkHLTJ7YSzlc3XZprmF94TwaYOek\n1RbjOzDn+v4SFV7zeKWuWMtlKroPtpt2Wj6jTvw6VYjoQO6jC3cZ46WeXbdu\nkUtKzh6nOspX1O8snBPa4bguF66dEieXoiOra/LG13gS14ad4HkrpICHwxre\ny0FfK/BezJglkhcD5milsUKItT8kqe6dyhnjFarNYs57wKl/nGLn34oiRD78\n/io0Tp5JtzUJ3olxXihznesJLi8bIzvAX0Irae6gKAp+6VaCm6sTEELyOuB+\nH2F9MDQSYvLLu/BSHjpE+FgOYcATUANQ9nsMpYzX0z4kJPI6ua+ppjA1dtNz\nylHYhRgA/ZyjbzU6g68r+9VhuvYY39u7lAfCh78ys0aszB31uAOPHgFN1Nvg\n1mNNJ06X9Gk1YIwVKzrEgumh+uCUw7Kv3u8ZxdE5VtlFL9lE3fCiFvOiegdJ\nL12zBUmxCeCBAx0Q2nDBqnSh1Kq4YvA2qZAxpsv3SnlaRDz776qB82uzmFdY\nOph+\r\n=aK+X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"yushulx","email":"lingxiao1002@gmail.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"14.16.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.2.11_1623139269347_0.28186723847076633","host":"s3://npm-registry-packages"}},"8.4.0":{"name":"dynamsoft-javascript-barcode","version":"8.4.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.4.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"c81c4a9ec1f1dd4617a7a836c53f1997fd5d22b6","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.4.0.tgz","fileCount":20,"integrity":"sha512-qdw/h+y9PIfi0uSdslrUzYmhqnwOIBbfNf2YEKJXZMWLqQSAGGrI6ebA2nifc0wnZOAzp3ayr9Qu/DUneQSt5A==","signatures":[{"sig":"MEUCIQCW+2MiOga8TiCemIcqVn7CFN6dglpHY5Fopoe/HuTYXgIgNjaxPsyMXqT/xm1NtHdJq8iyurt1l2hY81aniWHrMHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12136429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2rL3CRA9TVsSAnZWagAAtHQP/RRY1dByfmMU67PQPid2\nq4yGaWhYUBOXEhD1gGWi6+t5D9ULCYkGq1/qSIM2GGVGEhrcSO//uTaTD+s/\npQXQiB/+af6DpJHwWJyjDt+8DgzIajb6a3Jdt/JGpg1LMOjXFeaHv4djLUFo\nMor9dwqu7BeecK14u6MprFz4y7GsxrjvXXWzwM43IRFb2Bvj/5o4us5ns8cQ\n2fIXfXYdlA7bfjo1gABwTi2nwQGV2Yc3hyW4DpHQtvVUuwe4RoKJFTQ6UJWJ\nPzsXZI0vLQiw7EMwlhWls+3gM1FKeH4+Lj19NUOSpv/A1PWtWvJbkIh1SnRS\nz2udsC5bKwI4vsTSfq4Eb+mCIswp7ziM/yWM6KwV/L9e0j4NvzPdbiogOUPh\nuqu2fbec7semLNewNvdTV2xfWt3XAFxHf7ePqsHVjdwzOXhAsInhdQw0735F\nxrqw1GKCs4UlEoOeaoK105OjiRZchFVOeeVW1QqGCNnPpeWhvdGt4o0XQ2n8\npXuW7DUMwf8vJrxDlQecbBBPK4QpT+OsAMoKgbP2urcjtzepqdPWdBIJr1Zs\n3ANoB0whAQW706IXapKYb4o8UYJ+WQusV2Ko2ueeIYIBSspVOSwJhXekJu6r\nG30vicqc18lKmhvX1DICerpBrYd6wSpBaDLKxW2/LOAq1gJZA6Z5+/o8Bfg1\nwNFa\r\n=AQ+M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","scripts":{"test":"node ./example/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.4.0_1624945398681_0.569177000227769","host":"s3://npm-registry-packages"}},"8.6.0":{"name":"dynamsoft-javascript-barcode","version":"8.6.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.6.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"5e010f42d938a21ec3e101f9c4b88b005c0f1502","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.6.0.tgz","fileCount":246,"integrity":"sha512-uNKBon5D5Duqd8y3aOBH1LTpa5mWZG7AX82B2dJMZBfgpl6Qb1PWM+WXis21YJ6UQK4OXaQuLVyOEEsFPDpAHQ==","signatures":[{"sig":"MEQCICFUyiVIqOmjA4l7IkPVRdiDCFmoVsAt7lwOxRQxlgr9AiBKUsBKIKpTJagmq06ArcTbyjHCQE61+i60PNSb549COg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14289176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLeGlCRA9TVsSAnZWagAAXzwP/j1v+SZ1SSXW5ZkF6TP5\nHz+WX75JE3mmy3D6PjcE8pFdnw1jkGuZqhVIxOSnQm+wwHdjllvMsOEui3qv\nusKygI4HdsxZauWeo6c3py/JsgXO3Sk59xYHlXZDDzLH73ww23wHLvI/Fvv2\nGlVWDMpyt1CaXb6hNs1YMTALOpE+olV6xO7PW1txqTxoODo3AxpCHMDHIZp0\n+/0tUsRbU8ZyX0ch2ORSlLtvU47YxmiKbqKrE41V49oUh8AumB5qyd6KdBR9\nroR3H2/zBdw9xF+vP3AZJnKB8Rz7UCpDZlXVzSHj3S4+EiApsqOz9OF9JOMn\nyVF/gi/Gq1cuI0cBahi/fjC7dJkY1LYJnUOy+KEIpDDhmkeJayDwFETkdbbk\nYvpsxUO7NhSj9rPdef3jy2zBMp9M37LXFjOLUVMEvSBDexrjkaXsSu1bqynx\niDA/MgZOKECGd2RtH8MiNkqVLUQ2yrjuMKPKRvmthGkFqASjB9rQr3rHIDDy\n7PTKDHjzawbzBwL/EsewgoU/jZSiEReXsvO0oL4rCfLsId2M7+gepTmeR+Fa\nXUt3Jwz6Yivezl0Y+OFSr4+pAuPc6yrqDW4CEgrzDbrjFrgTaPxV+SSRIxdK\nWGQyhPBH7hvplwsNa2NSMcdERMUUHR54r6mdfBw8X3F17RD/p7zdEOK+4/ee\nzT0t\r\n=r5BM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"180837130b568777f176f4466527366d36cedc4f","scripts":{"test":"node ./samples/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.6.0_1630396837079_0.39692706335225814","host":"s3://npm-registry-packages"}},"8.6.1":{"name":"dynamsoft-javascript-barcode","version":"8.6.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.6.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"5aaed858c778525392bdaa3b06c234d2541d4cf7","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.6.1.tgz","fileCount":246,"integrity":"sha512-u6/vchGd9mMbRvOTrck3zDkEi5U6zBp14tvpt0XMHwmygUQHrxFIzM0wY1LZ9VrikLIrLmXb7tLecivdtt7fEQ==","signatures":[{"sig":"MEUCIQDQzeLAMyz5cNu3d40tiG6ARyCR/FTOl1g6CgKOg0YeRwIgdD3wZ3BcUlpKoU6pmGjz+Y6JYJAlFQ9J0DDKEXKIJ6E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14289386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLzrLCRA9TVsSAnZWagAAN/0P/1xV3Z5e0t1MaBJTjjV3\nsrMGJrBN23CJRlLgex6OYqtvxvT761py3LdX4gQIUs98al8jGSlNglTqCrE4\n2O+yndtEm5NAraSUVHo/Tgx3fcQsHpVfp5D+T1f7Cl8c624Pil+apuuCwP+t\n+xI3I5AsyfHqiO0pXCQu9nPgQJpvNKrihcm1mEWW6JXpU34zJJ2Q7Q0cOPbO\nAwxiMqyMlYkxP7m7Ip97PHBkvay/GmhsIeq8pTRsvemp1c895aa5gHgQoSOG\n2PNyCZ5/xhloRa6H9XjEQfIDwO+MtYxNxP6ewO3R2FWTCbSMBuNzM0kLGyBo\nGQ8VUJojq6OQJgs8D2m0XH68CbTzjFS8fAv4lidTavcuf+L8oWRu3P0uBHUo\nYMIqjaGKWZmEc9jqwGxJHiqhvORr2ModKV4jxOVUndV0bnzV63Jb5Gm9z5lP\nfqGDPnC3cHDydxDWO5+n95VkiKZSsrLM5m5qgBccuRVL3dZWkqSR5vZz2vef\nHiSJ8IRAZ0T4rKzwrI+p2FYCblSfNS6N4MHfIM92x8mT3ig3P5j1xQH2++Zp\nJ2u+aPCPJnvhCh5hmWss3D3+0Q7M7Uz50xD8gLrZ/Vk/F/gvSM2MgKv8mlVI\nKMGjJFJBC1wzzfbLeFVN5dVGgkT76ZL4N6pZhdpFh593Y8vWBlT8zM4/IQKY\nBG7p\r\n=jQ2x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"43894b3df900860a212162401bc893ed977d6441","scripts":{"test":"node ./samples/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.6.1_1630485195278_0.5854674138035718","host":"s3://npm-registry-packages"}},"8.6.3":{"name":"dynamsoft-javascript-barcode","version":"8.6.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.6.3","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"749def1a826f16e67c8eb76d51a899dfe9904b3b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.6.3.tgz","fileCount":245,"integrity":"sha512-+2bcTQ0VD9fry6i0dOPwTlEIV9TV+3Ic5HVg3LmB0kViXyyvpdIuAthMal7nxTW7bQbwAQCGYpDqSUEWqbPQIw==","signatures":[{"sig":"MEYCIQC/dSIBJwdCa6YZtMEnDTQ7UsAqNjUrT1GpyZOm6rZhaAIhAJVt3nnsPKIHCbOxoSVw0+QqiI1QivMcgNoN/W7pW+yF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13504752},"main":"dist/dbr.js","types":"dist/dbr.d.ts","module":"dist/dbr.mjs","browser":"dist/dbr.browser.mjs","gitHead":"3f4fc90c722d324b4aa453c13d7e60bb12a25eed","scripts":{"test":"node ./samples/node/helloworld.js","build":"dts-bundle-generator -o dist/dbr.d.ts src/dbr.ts & webpack --config webpack.config.js","build:doc":"typedoc","build:node":"webpack --config webpack.config.node.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","_hasShrinkwrap":false,"devDependencies":{"typedoc":"^0.17.3","webpack":"^4.39.3","fs-extra":"^8.1.0","ts-loader":"^6.2.2","typescript":"^3.8.3","@types/node":"^13.9.8","localforage":"^1.7.3","webpack-cli":"^3.3.7","webpack-merge":"^4.2.2","dts-bundle-generator":"^4.0.0","uglifyjs-webpack-plugin":"^2.2.0","fork-ts-checker-webpack-plugin":"^4.1.2","declaration-bundler-webpack-plugin":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.1","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.6.3_1632990808873_0.1938617627107806","host":"s3://npm-registry-packages"}},"8.8.0":{"name":"dynamsoft-javascript-barcode","version":"8.8.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.8.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"45c6f0ff24b0e412e51b1a121f821f0fc2c29dc3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.8.0.tgz","fileCount":125,"integrity":"sha512-rEwhz9BYXEzflZI87ebCeC/oRWIvGTltxaCN/bru2FXtEYx/JS2Q+eu/I9cTH4xp4e2NS2LfGI6ynYx4sAZt4w==","signatures":[{"sig":"MEYCIQDkBY7pscdYNV7k1UNuBz3FJHQOGuMJaiZE5Txlgzt5xQIhAPE2cEZcEJsLBac5YGeLv6fb4QbuvxDSBvOR6fz7PuJ2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14402300},"main":"dist/dbr.pure.js","types":"dist/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"14.16.0","dependencies":{"dynamsoft-camera-enhancer":"2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rollup":"^2.57.0","typedoc":"^0.22.5","fs-extra":"^8.1.0","typescript":"4.3.5","@babel/core":"^7.15.5","@types/node":"^16.10.1","localforage":"^1.7.3","@babel/preset-env":"^7.15.6","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-replace":"^3.0.0","@rollup/plugin-typescript":"^8.2.5","@rollup/plugin-node-resolve":"^13.0.5","typedoc-plugin-missing-exports":"^0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.8.0_1635415551193_0.7026305080989879","host":"s3://npm-registry-packages"}},"8.8.1":{"name":"dynamsoft-javascript-barcode","version":"8.8.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.8.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"84bf26ad80d296cc216197babf408dafe561b3f4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.8.1.tgz","fileCount":68,"integrity":"sha512-g7rNc5NcaH05CYfCj7mH8cWWTfc8IdnmKYPj2zz517xU/IAdF3d89sxA2S7ae4mqz+77/aqqrtp7CjMB7pp1jA==","signatures":[{"sig":"MEUCIQDQEEQxCe+NjBe8ZGS/A/jB5GI1hEJh2LC4yg2ostuRSQIgaaGx/iPzY+W4qMrtTfD1QAOVeoZFOmO/8GCr9x1RWgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13176994},"main":"dist/dbr.pure.js","types":"dist/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","dependencies":{"dynamsoft-camera-enhancer":"2.0.1","cube-dynamsoft-camera-enhancer":"^0.20211028185850.0"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rollup":"^2.57.0","typedoc":"^0.22.5","fs-extra":"^8.1.0","typescript":"4.3.5","@babel/core":"^7.15.5","@types/node":"^16.10.1","localforage":"^1.7.3","@babel/preset-env":"^7.15.6","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-replace":"^3.0.0","@rollup/plugin-typescript":"^8.2.5","@rollup/plugin-node-resolve":"^13.0.5","typedoc-plugin-missing-exports":"^0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.8.1_1635502230965_0.028542885319666533","host":"s3://npm-registry-packages"}},"8.8.3":{"name":"dynamsoft-javascript-barcode","version":"8.8.3","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.8.3","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"ed47040a7e0623b387acb9fb229a9bba83c7b2ad","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.8.3.tgz","fileCount":125,"integrity":"sha512-LL85kgfun5czDObFlvd7Kdm0o8Bl+76JhbaWyEGBuppCqt+qLI0ZeEmBQ91Ky3laVh+lsLEXLgiI34qFU0xzEg==","signatures":[{"sig":"MEUCIGUCozxe//aBSx4uwRESzHe+bQnIlR71MPe64iPHgpTGAiEA0oYIedkZfKhSaYFnvR5DB+Cg96kdxpDt7UjSecc/nwk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14400297},"main":"dist/dbr.pure.js","types":"dist/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","dependencies":{"dynamsoft-camera-enhancer":"2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rollup":"^2.57.0","typedoc":"^0.22.5","fs-extra":"^8.1.0","typescript":"4.3.5","@babel/core":"^7.15.5","@types/node":"^16.10.1","localforage":"^1.7.3","@babel/preset-env":"^7.15.6","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-replace":"^3.0.0","@rollup/plugin-typescript":"^8.2.5","@rollup/plugin-node-resolve":"^13.0.5","typedoc-plugin-missing-exports":"^0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.8.3_1635507198604_0.6446224876060238","host":"s3://npm-registry-packages"}},"8.8.5":{"name":"dynamsoft-javascript-barcode","version":"8.8.5","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.8.5","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"61cbf4703ba2c08ec4e5f376e223795c4822281a","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.8.5.tgz","fileCount":125,"integrity":"sha512-wWPN8n15lnKveODUnMk+AeZCXEcagrnd2OE6B9KCQEzZ7ijxhlJFyNzaIqOLp6GwT43/zgCMhexk4zUnM7PjlA==","signatures":[{"sig":"MEYCIQC6qToKlH+uUvDMen/kwTxztIEVK9EVl6jbSNvTI55k6QIhAPrHKFwozjpLeitwKiFfb3cLHl8fpJ9mY5wlGmCjgCz7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14089881,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8QZMCRA9TVsSAnZWagAA67gQAKHfNzGXlVA8zzakCmMx\nquN/w5IUBzhLyqfkLhCnJWNHqlYNQNuiAxMqSn3ZV/A36Wm+I02JhSmaB7LQ\n4j4s8WXCX5lmFvI29L7gDTzxwavyrC3lauMfW1vZLW3CUJC5Q5xQSJsWZjKU\n4fzBE1S+UlXH//4zCoXEn8ziMhAKyE3PZ/zFh5ifibEGG903+YB795UtCbXC\nIEUYWecpfvJNUtXf2OVALhOWbrXKgEkhb+2JMucJP5ae2HJxVdZY/ubbflFk\nemx2IFVRmjkn/3K05KZ+vVJWJTNJcY/Xx5i7ldnvuj/nVFIomliKOkP/oLb5\ndtL8bielb0+YT6xwd+Q4EUOrKW3rQ9O6wZwQsq7t1Vr/nq2XVKBTDtuEa8wC\ndJe2lQJ8+BVDpjx4QDk+z8JwKR4/fGHe12577AO/zegGNWWvRt9cNmU6GP/L\nkTHNxmMTK20hjRjHS8LUkYbuu9Lr1VxAN3QeawmpGy2e0XmgWT/ik/cJyl+b\nENt0KkC3EZJcAsqwOqYXfW1tXJayWMKmpSuBaFTRGv7N1RKOyUObpj+KmMPj\nKjte+MFVPrBCu74GmCt06JL3fgN9++Ubb4CyPbLY+Gxg7dzMBmFzUfBtEWTD\nb0GxwjS5KKwub2KFRhkSry9RHXDOSy6wrohc1R99jJzyMwfPFMtaSsnzFTAV\n3xKY\r\n=cmsv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.pure.js","types":"dist/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","dependencies":{"dynamsoft-camera-enhancer":"2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rollup":"^2.57.0","typedoc":"^0.22.5","fs-extra":"^8.1.0","typescript":"4.3.5","@babel/core":"^7.15.5","@types/node":"^16.10.1","localforage":"^1.7.3","@babel/preset-env":"^7.15.6","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-replace":"^3.0.0","@rollup/plugin-typescript":"^8.2.5","@rollup/plugin-node-resolve":"^13.0.5","typedoc-plugin-missing-exports":"^0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.8.5_1643185740447_0.9241344278175534","host":"s3://npm-registry-packages"}},"8.8.7":{"name":"dynamsoft-javascript-barcode","version":"8.8.7","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@8.8.7","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/javascript-barcode/issues"},"dist":{"shasum":"54e84d586717380327c158a0822f12013e4a6090","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-8.8.7.tgz","fileCount":125,"integrity":"sha512-Gm9vCuUQq7PJ2Am9u5w578/vAMvwVZle879r80eMfAtO7KR/CRKnNHO0mk7GOWHaQfb/Rjmtfu/IQ1iUbSNeOA==","signatures":[{"sig":"MEUCIEmlsdbinZ3LyS4aKdfbAFSgRMWnXZ25Nmqz9sXskNb7AiEA2nFPBawjwz+hOemKqxHfBoo/roDValBctJPJGg6Ch0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14055260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8RCyCRA9TVsSAnZWagAABQAP/Rf2kMEsYxlSPAgkgUQ6\nanjTbf6e/s0WOTnSfLk9zIcp3woPiUZsjzHwO1OIdBNdnvuv59S8xswH2wFk\nvoaKyLXcqcwnasZV4JfaFpOIWdc4d7ExVJUucSqKF0InDzRR0HX0kAYkW96B\nuBwNJcXW7muTcJZXzAgIcjKYnP5frW6LDQsmMTmZXgrWCxdgkLwombjAsOZZ\n+U7JWE7Q/540cDfnqsU6crW5KsTqPSR7fGIwIKCxbSNYMkkMZKxl/aw7asMR\n32rSKb878te88GxwEsntdhCWNxPmeFGE/eCtdmedI8iEka3b9aKKhAtsmUT+\nh1wx8TTAbQySKzvHBvGEznsMlHZMQ8qZoQt1++27DV0uGewxMG60BWc0QA+0\nm9G3AT1PiQPUw9fgKdZ93TxmFBV5qYi6FSbDABUuZtZ67k3ls5H1Zy3SGENY\nrAqzQvjHaD8tXrxbakwhjdObSvIInMeatCCs8ChEH8lV7z0MZVtb8EAcJIIG\nO8xcRAak93s44vEG1qE5pAy7BfbA76R6GUe03a/NZYBjfJEsp3Kq8IcW549v\n+k7t4q16khjy07deDx93AIKcvBAdxhyTjE6NyCTJ36tyDGMiSkTReQofRV9W\nEbin3adx3SO8jyyCoQ01Kz0HfYUqdO1LjrOiTyFYZ71xnD8gwilsIXNIYSBJ\nZI4b\r\n=UHnN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.pure.js","types":"dist/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/javascript-barcode.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","dependencies":{"dynamsoft-camera-enhancer":"2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rollup":"^2.57.0","typedoc":"^0.22.5","fs-extra":"^8.1.0","typescript":"4.3.5","@babel/core":"^7.15.5","@types/node":"^16.10.1","localforage":"^1.7.3","@babel/preset-env":"^7.15.6","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-replace":"^3.0.0","@rollup/plugin-typescript":"^8.2.5","@rollup/plugin-node-resolve":"^13.0.5","typedoc-plugin-missing-exports":"^0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_8.8.7_1643188402091_0.8100582708507704","host":"s3://npm-registry-packages"}},"9.0.0":{"name":"dynamsoft-javascript-barcode","version":"9.0.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@9.0.0","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9edaa33539c2fe5820cdd9691b89480993ea4524","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.0.0.tgz","fileCount":118,"integrity":"sha512-O7q1Pk9qYAfmLUz0xz/qZ9zWyIqnmqvBaiaWALWYWbl3f7/L7rHJRzwWbj9P3o6CK3Aj6imsAAV4+d+uPSmwPQ==","signatures":[{"sig":"MEUCIBH9SmivS0yU58rUtW7u5vV0q2zPosZ3lFMcpMBuQAwLAiEA7eKl5FW3x/G+BiWeLEHH02K4oO57aV5mafeEW09Ikk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9804618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPB/cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoy8A/+I2fn4Uky4NDjshAtPg4+IAGELFk+qRbQZvCOnZx51FM7NYF4\r\n60h3sxuKXwwne9l8A2WcVtSd5am6YA6aRBbzBitnTsYXdYTeWEUjFKzJRDnO\r\nqsxR8Xgj6wsS79wNj+ewHuLE1loAKyed1HZmY4SD+6G1RlPm4t8u0oY06YDq\r\nyq/XoygHFOUUtuWD6aTROaDk2RHmeX1SgNgAQHIbJ+l9i507hMXSqIzJGuk5\r\n9giW152MOtnSP3cpTRyV+TSRP/dDFp9uofN0MlKTJNKFoghBHneF2V+8eSo1\r\nX4HBTOrTUHUET/NkA7uXjilezbtdTLLs1BuyJDNDT1vvsXQOx41zMPWxIKzh\r\nQAXVUKhQ+TM2fHIuyMb/O7IQWk7uu/R2ujy+F9/RoFQdjorAF6Y/n7GmnoR+\r\nq0c9rA395QVOrG16048xrvYxthURP6PLiReoElAftOmofnYq6gZdQMANQTWU\r\nI29MtNALwtzJpcgp++tOPcgkHFRbiHOGaW8UO5pF7uP9vg6EyS/4nrASrTLX\r\nGWp004F4czeixqy1wqwSBUoztfZfijW8jW2XX1bRsqPcoScCIAh4FiBNJGtM\r\n9AcMx02moNougcCS6XMNf5wEC/G2YTegEmd0060JrDv/Hfceqk4tB/p1tBpU\r\nvicP5puXIjfwebxhOuqdpR3w35Dchht3rDQ=\r\n=JfDb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/dbr.pure.js","types":"dist/types/dbr.d.ts","module":"dist/dbr.pure.mjs","browser":"dist/dbr.browser.pure.esm.js","scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"~~browser":"dist/dbr.browser.pure.mjs","deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"_nodeVersion":"10.15.0","dependencies":{"dynamsoft-camera-enhancer":"2.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@babel/core":"7.15.8","@types/node":"16.11.2","localforage":"1.10.0","@babel/preset-env":"7.15.8","@rollup/plugin-babel":"5.3.0","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"2.6.5","node-localstorage":"2.1.6"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.0.0_1648107483893_0.37178548779909004","host":"s3://npm-registry-packages"}},"9.0.1":{"name":"dynamsoft-javascript-barcode","version":"9.0.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@9.0.1","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"13c674349c16d19ebd6b7f8d026c9c0eab6fde45","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.0.1.tgz","fileCount":121,"integrity":"sha512-NKCFYMsJ8WbOEeRY4cXWSbuzVle1QbYTXCfp0OQpd+OlxaC3ezmWxR5lylbQ2Hvlr9o9XLQbwCfv7D8npC0KaA==","signatures":[{"sig":"MEUCIDgpBwvQD2JCEo2G7AwwyYLM132YporuG3cEgTZIa9w9AiEA6Kqzvyq/Aj9vxF0yvsrPD8UbqkWuDP5nOJnQlakIwS0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9391240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZgVwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8TQ//TfePkiDEr/oop3fOASw/VImjgjdjDb7MdeHHxffp7SaJjfrN\r\nhbNViB+gIgdg+OOacVWuzlDPVn7IYEzrxK76CsjduTDPtSm1K3/tq1fQaVKa\r\nwBn/PAgRdOGsMSNC519mBviLPJuNMqzznzJZK2sFyre2JNplwlbwaJ+2MV/v\r\nKLwvYf4T7GgCcM8xoKvK09wOlzxFVxJa8YnNwmFLzhx60pnqJgdcFVn1meKP\r\n2U1uIexytPJeTzrzVYXTMx+3b+wso83dZAXqKPkaXWqn6rPsz8HRMgROzFvU\r\nzufJm3iIWy1V6YEJqczlUiqNpZTb5H0tsCxrDpwYfia+jOcXhzktUGpSHl3M\r\nq5sr0SQPYBUWkCrEUXe/PjRrPL0V6vLCtTo0ZJn4yEF8p0lXMkAY4yCIvMVk\r\nJcDJG9hYDOva9MrhdCAFTNXUuNymb2QlTx8U4kZGpNl9nNoGda9NIf7nG/mK\r\ni568A8hR4NlOak4Q4XXkflQ06nXd2AqWWsRLy4AUP6kuSD9KHauryKT70DUt\r\niNswf/Hnrb9iOHeXLlTkcX1kX2xAYB3XLcdZ4Z98EsAXcGSl5cFv+2jPvp+s\r\norE+vLeUyCgaq43nP6RNdPvNrKLPN9nwLIy4xfz93bf40ogGTwtdoWkLEPEu\r\nR1fzcXKWqifuYyDFQiDOLmy6LslIxDlm+qQ=\r\n=jaNs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.browser.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.browser.pure.esm.js","exports":{"import":"./dist/dbr.browser.pure.esm.js","require":"./dist/dbr.browser.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"2.3.2"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.13.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@babel/core":"7.15.8","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.2.tgz","mutable-promise":"1.1.13","@babel/preset-env":"7.15.8","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.2.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^1.0.1","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.0.1_1650853231933_0.42500971760378237","host":"s3://npm-registry-packages"}},"9.0.2":{"name":"dynamsoft-javascript-barcode","version":"9.0.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE.txt","_id":"dynamsoft-javascript-barcode@9.0.2","maintainers":[{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"e211744fa92493f561b9469cfda5ce32c1a4970c","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.0.2.tgz","fileCount":64,"integrity":"sha512-DV9By909rdvBQqa5mijX7y4s33ku2wovHUHGz7OB0evevUSAfTkPAzM1DSuhpMX6RYJQ5cGcHA6H7VJZUsEr8g==","signatures":[{"sig":"MEUCID1pC5DtHsFYvn66Uu0ClzUHXwfp9BB4XvRJmXXh+zWvAiEA5cC6V/1tiPLNEyXsBKY+yH3TaQte60TglPjPvd3Faio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8284927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidLAgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVwQ/8CVeZqILrmu4jvgX2Y8IB/VPFishIdF8TEGoXY+NH4vJbmwDT\r\n4UN4wuS8KfFIb9kpn5SACBxFaXiKy7E+O8oneR+r5tonOSZOydDMfwrW5yFf\r\nMTEvkH3VVFQqM6VknScRDdrwFiWCgpNI429lurdIucdzuQhzdammZWFw8U6Y\r\nZS499xAPIaWnkGWE+BE3g0lJNNPdzeT29XQv1GI9F37AQ74Lv9jv5VIjqZs6\r\nuFGAGXYjgzfIzUHs1tTxTnXNVbyxy1nxABuq28jq40kpOgojl6SqCPUlSheN\r\nXqtX/TrgnEaG5KtWCpSA6bNTzy0GhAuQeW5qp6n55xGNVLwMZwU+eTANMU8k\r\n/IBN0N+mPqSQI8MkN5mXZmky9dxP9tfX6Nzrg26MttvFUZylzKckrpzei0hy\r\nUe8zk5s2mo7oJrha88Z6EdXkV7ikZOu3qCu81xsLR4HAL1IKLykz6abmEwKr\r\njccNd4kBqztckaltGuUGBNxyq4OLlJIZgzD9kEso5Qfb9MCxhzx/nCxsEbEq\r\no9E/Jc2zarRmdz87y5/n7bb5cEQJTYS0x/HcaFgOo694F9RkefC+ILke3zBc\r\nfvOmfkOF1shSVPd2tWzx21AC9EMeNKKxUeaocr8sSCwUML8xkayQe3zKcff2\r\nqm9g98QEaJX77/oR2rVP/aU0xAMLO3KSAK4=\r\n=xaAH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.browser.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.browser.pure.esm.js","exports":{"import":"./dist/dbr.browser.pure.esm.js","require":"./dist/dbr.browser.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"2.3.2"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.17.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@babel/core":"7.15.8","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.3.tgz","mutable-promise":"1.1.13","@babel/preset-env":"7.15.8","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.2.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^1.0.1","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.0.2_1651814432545_0.5940197315833153","host":"s3://npm-registry-packages"}},"9.2.10-beta07270208":{"name":"dynamsoft-javascript-barcode","version":"9.2.10-beta07270208","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.10-beta07270208","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"ad0825c764d013943a2698011b57128e643280a7","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.10-beta07270208.tgz","fileCount":65,"integrity":"sha512-Q1OQoe5DWwv+fEep2Fgp8ACz6s7JkJsJREHnm6YmTp4l7a/1lLm/Mt0FtywshTvbztJ7T3uSJBUf8QauOgF1Nw==","signatures":[{"sig":"MEUCIBFhjj/KzCA2ItONj0mpXgoqPG7jCdcCK7axdQ1z6cmtAiEAlgAbqIYQN9JA+/ap67NLNLXX/e9tZWeHMI4aDdhKL+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9364251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4QFKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpWg/9GjOvNptuDQvW6DYJV00mlgfCVSt2S6lkMPstmrUnillLAkWC\r\n0vOvoR3i2iEXVxfqqRvsxxU2lw5uz4s1Bp8FA6p5MJeMZPehFL4gkTROJHdk\r\nGK8JzOh6cnqQm5+b3ZcAhuz8mBDhII1JLvEi8X0ilcWYiIsQCXqBLVeudOmI\r\n2YqhpQkffk1IekPPDVAPqNo0q5IIiz9sIi42zqW5T/nk8RcZCdfc/WUhAEWj\r\nluZCYB9lI+DH72NjdbmGQDYvHf05crXAkwL7F0b/qXeFCb1s6P/NV9Embpcb\r\nrxmsx07yGaklA+aofHS46AsXg3QjwUINarv2kUJMO/YtBOUepzbP2jS+JORX\r\nrXysHJGe8IZS4dvhko9wEwk0J9TXo/HfMEj+eQzZkj/Duwa/XDMzU2rB1EHV\r\nc6xVFcaEoMk8PnDN/40vpdI1qdeNse2o7iT0xfa68+07Fey/TIVF0ZvTZl9d\r\n3MQPaCWwluUX8um/xRy80WYmy3lJLSpLOjIPzrGJRaxLDg3qNG6HQ7pFXucs\r\no+PiYQ556rsNmX4ewKhFyN1T22aQMs2pLPX5WZSSRQTNUuu9gq+7ZMyhebNv\r\nNtBmlOzg5ip26ENmzdbHI/1Rkn2hMj0dBcalitTJzimF0ylXBmO5KIBSvEZU\r\nCDaGd7iQdxZ7YEOB5Va33B5lrmgJyRs8xDQ=\r\n=h0Bj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. With its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce integrated, your users can open your website in a browser, access their cameras and read barcodes directly from the video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate this library into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the library](#include-the-library)\r\n  * [Configure the library](#configure-the-library)\r\n  * [Interact with the library](#interact-with-the-library)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [Advanced Usage](#advanced-usage)\r\n* [How to Upgrade](#how-to-upgrade)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.0.2&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.0.2&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.0.2&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.0.2&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.0.2&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.0.2&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.0.2&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.0.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.0.2/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the library which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Step One: Check the code of the example\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.0.2&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the library\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.0.2/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.0.2&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the library finishes scanning a video frame. The `results` object contains all the barcode results that the library have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the library finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Step Two: Test the example\r\n\r\nTo test the example, you can open the copy deployed to Dynamsoft Server <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.0.2&utm_source=npm\" title=\"Run in Dynamsoft\">here</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.0.2&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the library\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the library is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the library yourself\r\n\r\nBesides using the CDN, you can also download the library and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the library:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.0.2&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the library and where you put it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.0.2/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nRead more on [how to host the library](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/advanced-usage.html?ver=9.0.2&utm_source=npm&product=dbr&package=js#hosting-the-library).\r\n\r\n### Configure the library\r\n\r\nBefore using the library, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe library requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the library, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.0.2&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the library from the official website, Dynamsoft will generate a 30-day trial license for you and put the license key into all the samples that come with the library.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the library where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/\";\r\n```\r\n\r\n### Interact with the library\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the library. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the library, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds)\r\nscanSettings.duplicateForgetTime = 5000;\r\n// Sets a scan interval in milliseconds so the library may release the CPU from time to time\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100;\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\" and \"coverage\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.0.2&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.0.2&utm_source=npm).\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element into your own web page and specify it with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the library will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-video-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, 8 hard-coded resolutions are populated as options. You can show only a custom set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920 x 1080</option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280 x 720</option>\r\n        <option data-width=\"640\" data-height=\"480\">640 x 480</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the nearest supported resolution. As a result, the selected resolution may not be the actual resolution used. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the library will then use it to show the actual resolution.\r\n\r\nSee also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.0.2&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the library at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.0.2](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.0.2).\r\n\r\n## System Requirements\r\n\r\nThis library requires the following features which are supported by all modern mainstream browsers:\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the library to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.0.2&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the library files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari 11.2.2 ~ 11.2.6 are not supported.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the library. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## Advanced Usage\r\n\r\nIn addition to the above basic settings, the library has many more settings and options that you can adjust to best suit your usage. To read more, please see [advanced usage](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/advanced-usage.html?ver=9.0.2&utm_source=npm).\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the library from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.0.2&utm_source=npm).\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.10-beta07270208_1658913098100_0.7787777005416834","host":"s3://npm-registry-packages"}},"9.2.10-beta07271933":{"name":"dynamsoft-javascript-barcode","version":"9.2.10-beta07271933","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.10-beta07271933","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"dc7304c7046cbf41918934595311dbb66958b626","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.10-beta07271933.tgz","fileCount":65,"integrity":"sha512-GMe9unJA2WeMqh+cnSrDIMnhktaciuZDXfR22EWkplx1WjgNDOT2VEH5Nk0cW5UzKgVUndpuCxFStDWWi1yPzA==","signatures":[{"sig":"MEUCIBvqJT/8tsRr6MCrwitomm/MmogpO4kHBspFpgSyUuoDAiEA3MDjomkwTHrNjALY2DzmGvpoHixDt02sJKC6ZOYIb1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9368946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4fY4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6dg//UXBzMDi+LT5085RDDcohNotwK2QwY8zDfQh17Mi8lHNNwgxS\r\nzuQCeVQx3+ZFeghsoUHzWXjVzd1dzQf9hYxy8H/heCOOygmpV3gmT3lqZaJI\r\nAlNkr4jY4J+r7LypduWJyl40zqsToUqcmijy/t9APSVfxC8ONjley/WIARJJ\r\niT/KyCCn2X/56MPoUc+C1p5cPFqMcIHCj4NrohGO+FoIWK2wLevYYnXazeol\r\nkjCXWUgBJKZScdlH1Q4I0vsl754++qmHvXauk6LC0YR7qAetrmZXsxD7kP9x\r\n8FWF8W1lJtMubK5wALb1QJ9HM9DXP6PiNSQgt5ZJon1Np8MmImPiBYZeF3dS\r\nr3z9TDqV/N6PCNsNriaVd8aeU42weN0fBeGYZoF/mQ29mZ4SL8lJ2o82UNUr\r\nc/SMIgGj3pwJtIalNX732IyuP1Wlyz9AsND2xCNdc2qgsywMxnBJ7z0yjE3K\r\n8QdPuwrgKYwM1ZfWnwNUKp48sy91zw/SJGJN/zDmKLdkrfyjSq9stoyy16lX\r\nzms1eTJAijI254n9E3NZS2tfxqd96AGRnBJtINkfAn5S43u9Wxet5ZnTGMAe\r\naXGJuu0vYwY7X+VfT01oHht3tGtPL8h52gDhCHTSjszrE0I7HoGB8mX48I1p\r\nwRTjpGahuOFelGzhnLTe8SW2qHHloeh4Swk=\r\n=Is1E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.10&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.10&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.10&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.10&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.10&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.10&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.10&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.10&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.10&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.10-beta07271933_1658975800092_0.9833756217073526","host":"s3://npm-registry-packages"}},"9.2.10-beta07272246":{"name":"dynamsoft-javascript-barcode","version":"9.2.10-beta07272246","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.10-beta07272246","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f88b93c4a8f1973038a324eb50c7c79264bf3064","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.10-beta07272246.tgz","fileCount":65,"integrity":"sha512-nJuxPWhVRe9AmvkBj4WugLoWYtq5SdKMvCBdtgGeWXeaPBOIXb9iF80Ka9Bri50L+nc+mShHo6DDTe/T1x/b9w==","signatures":[{"sig":"MEQCIFFNVn2514QqxHkQza1uAsyKUd7iQA9Ok3UieUFVyGF4AiBpOxKIobdIhux5mFavclj4w5PS/M7TGmS4YCosR1S6CA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9369707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4iNwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNPQ//ZQ4Td4o6v3uaHdqsTyQD4uc2LBRtWIaCpzccGBBuHXwLTZbz\r\nedwR+98poVVBS4M+QF+U8LkVw2toxKwopKFY6E5QMkVnHHJsR0CaTQJuHYdw\r\n3uM5aX0FiHNLOJohULVlNurusGY1Gy9d0dffpqmOQBRDCCa6YVYRzdyVuDQq\r\nC8La0/lnHBQkhAcV9sxBlDugSUaC+Ym8ufA/4fxmZxhoLx9xfLRO0Z5OlFt3\r\ndj04a0qrJaWALfjH9mjot9ChFDXICfzT2A7QQHy/jXCco1navT+dNQFX1fv4\r\nP2Uh9NRTQl3JMXkXMXC87TjOunMRuRCwknnxImj+Xq/dlvpZC63jo7XprzY6\r\nwcGIoK75gfSX/qKf46Pv52qETqZj4F/kgzTHbDgt6SyvVkle2JMFutRtbm1s\r\nLMFnfL+ymsgW2b215tpBXNF5sr1tYGDgpf7mQGQPpubUOyuhJBbHYtE0O1B2\r\njv+GRMWrpjFBL1v1ka09+NswNtya3yjxqC06FPNEefsA6OuRjp9qtmdsn41o\r\nslnBCdyS1V9pnR3lrbu5HErVdA+azv0NfRL1JzXj1lHv09BiUUeMV4wFDM72\r\nu5U/Z8v4rR+Mj5dJg87vAeJ/JGNyJBXVeioxgLRxxvrIrNRP3su5iK0x+vVv\r\nEwKJN0biZZx+dl8wHVUPXBY/ZOrmsNoe/sY=\r\n=PtH2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.10&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.10&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.10&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.10&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.10&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.10&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.10&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.10&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.10&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.10-beta07272246_1658987376596_0.5293282790067104","host":"s3://npm-registry-packages"}},"9.2.10":{"name":"dynamsoft-javascript-barcode","version":"9.2.10","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.10","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"133002ed114aada0cf60eb3c6fe1545d1af87ea9","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.10.tgz","fileCount":65,"integrity":"sha512-JjhM5Upjiywk2piosfehNKNc4AXgeSuCDad14hXPmrMRFIsemVeUBkfEp0q4tTFQr7H1Gmik94yk5Ls78SatlA==","signatures":[{"sig":"MEUCIQC9Fh61EB0z5uf7j4Ef3v5d1HuCybDNy3A9VYHY4xhdxwIgOVD/rCfsCUUgDBql7/Wy6IjwAwZT19N3g1Rd7cLSHgE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9369694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4ipsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6Qg/9HAY732H+B9wIRHbNV2wjkq+HUJui67XSjhdqRHK2GO4z12vH\r\n1YjzlSBsqcyeLqCg+v1HIoU0tl2XyPKDrEQKDGFjvJ3sw++BP4+qM32oH3x3\r\nQ6rD/OSteBsnBZpnzT69PgOviFrcJilcCInXo055W9Bap4vP5Qnb67lpTI5N\r\nUeYUy3eN94QLfJoQAzyig/OxpJbYLq/AacJvUehxEGJ5G9cuNPetRLZl1fTT\r\nI7FE6hvL8w1KKwMYtoinNCBgV7ClbeCk8gGdRTcazwaT3odbboebIRnZgDLM\r\ncWM7hn6yyvIMvXaOwiGhEZDYHK1aYPu3TrFz9R0SnXvLHPcNK4z+Jwaa5QpZ\r\n4uhAmW2rWEa/IA2xIKeYx8Bi7spHDGQgMPORDoF6wwjXbuMvFltyp1HPTa0l\r\nvwjvYPuHX4+/6FIcwhh+yBwydc2YaT4OBJiFVaFSC98MEAWpQBVU4Hf9UMov\r\nQjYGSP0QdsvMxSu1AUO6e+zPpJGVLD35jVKVbz490mrco98/qYI8+mPf6aJG\r\nd3Vp7cc9wLXnkzThGOJi2jF1p2GGhb/0ZvRVrUNfLiG3C8sJ1MYRATk1vSB4\r\nlRbFFznnfKrSguGtnjQFTlvoCuqfC5o1WDeHb+9L73gL86bLN3Jf30RmQphl\r\nula1j+WFpw/isJ2i7+nq5ONdQjI9bE7vDJk=\r\n=lKSK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.10_1658989164343_0.32744533944431686","host":"s3://npm-registry-packages"}},"9.2.10-beta07280004":{"name":"dynamsoft-javascript-barcode","version":"9.2.10-beta07280004","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.10-beta07280004","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"668197c68c29b55eda6cbeecb84e8f5b7d41c3f0","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.10-beta07280004.tgz","fileCount":65,"integrity":"sha512-H7WI3SwSVcLcXyPJtT71LR7aiKmzT5b2c2pBerw3OLqSPu72Jys5i2EL645HDH9w2Ehbe8zP796Qjq7qGfOjGw==","signatures":[{"sig":"MEUCIQDW0g0AUPmebZGzUUP49DnJOU1Fhr65WBe4aCmwor0UwQIgYHHIGavKyYVbDQN42glTH8XWxIfVW14BEEzPWbOltzc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9369707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4jWaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfGw//Xovy+3VKdk4HXy7mSFExVus52rI398YWW+v3HwVLiIt3oaAC\r\nuEIkO+DaXypSoIYOzo4Afw2zR/17IWaLBvRFFd+MnaxeUvzbyZQ3dZ7EDVUi\r\nP7rF7UX8ljz7llOxst+cso42O1R+Q77QjkSIHVpPAqJxsbh0z0ubStUPo/xx\r\n37guDuKraJD8f2PZADe2jlocZ3RqMOlHTcQYbcTxB3PieSyhnAK/QfD5BONO\r\nl3ttiO8vbqmEFx+WOWJLYB/a3hD+O0SXvHn3SxpquH0d6kiITaQSsF99Gv2h\r\ntZy0E6UBvyRGzPYUDP9Boga/KREJYagU7Bsq+xHkausIi120tne0Ov8t2fzK\r\nkbvcRqvbzNfI+OUyeDjesKOtDap/pri+IXzhHwMV2qkrYJQqmNZhr1wH19aH\r\nNLKSTJk+U/z4+lyEYsP9s3f/ghTRvkDw/amtJB9wn+RV1gzUYgBHBkmkHSEc\r\n/DYW7I2Qqa5SoW6o6my3Z+LLJPcb46S4lAo2ZhOzzWZ5OUP/3Y1+f0WWT4YW\r\npMNPSrK2Ixam2XeN6jah+aPv1ZdGXpScdUhEijFC+8hrGv++lkTH4vrlM+e8\r\nq3rDaMoLhHmbGC6t68E8NBDx9GdFvfuUCr9oRktBuyPzusTCls29Zao/tMH4\r\nmaBnOJMFBrxXcG+8GWudF+eRghcq1P6idXo=\r\n=FVXI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.10&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.10&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.10&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.10&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.10&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.10&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.10&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.10&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.10&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.10-beta07280004_1658992025913_0.3894519748727858","host":"s3://npm-registry-packages"}},"9.2.11-beta07280205":{"name":"dynamsoft-javascript-barcode","version":"9.2.11-beta07280205","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.11-beta07280205","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"d6225642e3f07a7a6d3687a1f4307946ae2d207b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.11-beta07280205.tgz","fileCount":65,"integrity":"sha512-boaYbCDUilCQxNDUrM4Owe/ilLwDyXW6YK/7aLadvizCNkY4A24it/VcVETjxVdcCeCJo6lXBAr8UT36/0iFCQ==","signatures":[{"sig":"MEQCICsrymQLEFmMxOQaPUOSn0tHAlMCTE9BHcMeJq3j85SRAiBLvBTPIMY6DoD54xVWNJqJum4n+L+PE3nBqvIdXZu7Nw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9385456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4lH2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/AA//UVWVg4RWnwd6ZbVG5iyqizdnqHc5lH82JM4UA9M8e9JZxG48\r\nZe7szgCJER4zU618jZkDRAfNUBg+Y4VIv2+O0uQ+jDhoH4xOPi9XrpxSmrWR\r\nFlag5p9ZdUI1KTmi6XdwD1VTgod98lbowigvEGp82IaKdchMjRmOif1l8UNL\r\ndK3D3AgtxAcKPrqA/qE55WtcEfyMxhiRXj9+acAwjjRZlC3FYUzS+rYQM4V7\r\nlIXwkr6kBySAwOK+0xwzPCyLH3ZZ+/A6rC07r0Jz54uvzLKZH6gpEkx1dOCE\r\niV5PQUYI+kVjD6WK5v2HEHymcjcPyBk1LdjHX13ERNprS8J5rqhiI0Rt/4ik\r\nRH6lkkGphjQZP7xqelBr1JT2cmnjuVMBDrKB6FmWT3SVZNQadHRCjSOmFlUn\r\nvG4XECsCiHEA54jIRgmaiayZsVxKJk8Mq7KWHqA6aAAL+ybc6ekRYPZGRYR9\r\nJ46LbhbjPk3UnMtNGSrBtZ7RsU8NMnoFYiUqve8KYX08lEtkasJoOmjxguyb\r\ny8A1fyatpYcdgJNwr8FazAsDZwu0N4dr/eM3oy595MS333TBgy7rS59igk4v\r\nfsemhUjbUKB0svnAGZ0yGODTJfX7tyadBEofpbQJu5gZtK7cZSUPKOTNhHGB\r\nCH3YiTSzUNRl0vEr5sK0BIRooC/OMveo2E0=\r\n=4iU3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.11&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.11&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.11&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.11&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.11&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.11&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.11&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.11/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.11&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.11/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.11&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.11&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.11&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.11/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.11&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.11/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.11&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.11&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.11&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.11&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.11](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.11).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.11&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.11&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.11-beta07280205_1658999286086_0.3692437202392467","host":"s3://npm-registry-packages"}},"9.2.11":{"name":"dynamsoft-javascript-barcode","version":"9.2.11","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.11","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"eacc067bcf2c16fe3fe9f4b92b70954697bc0cb4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.11.tgz","fileCount":65,"integrity":"sha512-ZrepNtFCJddZ8D3TUpjqCyGG5atrSS8KzcHAIGdTtkU1z9rAQpwEON0njg08mFVciN8dVloP1gLj5nPND07Xbw==","signatures":[{"sig":"MEUCIQDAlY7jOiB1LUJP2Xadz4x4dU154AGprLSeMjQOrnF76QIgNF3RLOzB8Rp+3u50sp3o4mT85Ot7S79vEak5ajfrYVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9385443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4lVSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqI/w/8CLbi9RAvSw5foZvEu6UkpvquFcTudTwAxNHpVxj5EcntvBvK\r\na3rjnqEPMcizqYkz6XQZ4QdwoqMSdKrbSEtoFSUI+war3Lp7YbwCtqDFwIzO\r\nUvJiJI9d2oUbhECvkgWEmxqsE/mu3t9q7rATXIweCS3rfY6HGJmWqFcbbviH\r\n7a6eAyMSITmrtqzv6A9f/a9yJVDsHSVFnc8e7HQiQtXT2ecCHsTlOZvsqVM2\r\nwyQPQ95HT/iH1ptGpLRCdCyO0/nwX6KMreqr5G2iodToIMrj/kVAnZtjn3WG\r\n1GyUb8+1aHwGyTb87xvdSPm0SoleFacpJe+cqajjLWITsiHkS6c1U4L3fZtH\r\nQvOON0k1r0izG3Zmro5QdsTNFq3MdSQjiLMTyF7jdOWFvzhqVlDlaKFxmPXh\r\nk0yXBZko2/E6acgn2acA8n2zvmWbg/ozAqJEosLZxIzHAFunk4aZMPXwH+OB\r\nSZynUqfcm7ASBT1oDJMANcdyBNBRX8Az9Vgx7QoQtyV3VMAGy6mTySiK2l8I\r\nawhBVpOGu/yTvKz5494DzKYlzuEZ7AClOSyK6lsA+Gw6d1jfn1LdmR5qZuJQ\r\nz4Oijujm84Rkd/bWT9iHFiAb/JfPtpeBaCnBJSDHwVjy5CKghZIBECpDlyIe\r\nj9eMFmu3lA7Sj/wNLNA6T8K1F3Ht9QNJdi4=\r\n=JE/s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.11_1659000146322_0.9303663588529689","host":"s3://npm-registry-packages"}},"9.2.12-beta08032257":{"name":"dynamsoft-javascript-barcode","version":"9.2.12-beta08032257","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.12-beta08032257","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"6eff2c5176e9eb080170a7044c63e582711c7c20","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.12-beta08032257.tgz","fileCount":65,"integrity":"sha512-kt0RwD+WyO2VLDezlCmy0h/DCciGaC8K8IYQj5wKjJ/SgQLRnCHqty1xoT6tnABZd7gqpm/wLWmplebfTtohzQ==","signatures":[{"sig":"MEYCIQDmhDR3SGMIFYbEmh5Ig717tZXrW1RC2Wtk1wW4pkvz8wIhAOEcp8m6orr6ev6qebWqetudoZAgpF2D8OAXPSGAUw84","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9386063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi62BgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjGQ//W5Fb+Iim4KUlVDMCz5lXxEnaZPFycRsrfUscbtghxr7d7QNd\r\nNqAPJ18+cff54mv3aVYcpVe/uG1vO8y4BlyWCEVEsDaABijcsekAS7RAyXi5\r\nRi8bs0ilnLqNxvZU+XWPxl/QTnmVVoJUBFOUwE8Z/+LeubbcL3HmXo9pn14r\r\n687KhUJfiqhQldtnQ52OeDaKg/SHwrkAm2fImWtLGvR0tsk5fkN4hEbC8bSA\r\n6IxHcFbLJ90dVBX+s1mq5g3nnzyPUkjx636sqohuZzWDXfWfT+LH+WmUmDJ1\r\nta/2cIeapngAl+tvL8L/fGKoWSEPK7TcRDn4XiAXJ+EJQRXA3cwY0NloChZu\r\nuxnJDetu9tpcsxs4Y3XdxX5QPQ8ixZqVXdcaDzTOGTR5KR+D65ofnrpYHrw3\r\n6sAdfd0g1eh1Ohm6u64+ZKj0Hu74PIvnecBFhjbPlj9PrSewV2Ll9YPnAjcg\r\nMh5u+pUU1VpEC7Qw9d+dwle2jZrOlQ9cO1hV3ng79Ed+iQPREVTxd9R9jHcN\r\n1e/hyNQ+1Ve5ynku+vDECsiQlSRok9dszCUjfsa74OLd5nyWEr1cn/A08thP\r\nmrtk2I0upISOKsNd1Zx2JxL8VMYqZsJY3FLKL/1TlkTATV/Pa12783tDoJjh\r\n/BOQglVfREsh8ZtC+QbTNKG/64ZmfCt8pTA=\r\n=fQKu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.12&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.12&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.12&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.12&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.12&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.12&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.12/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.12&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.12&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.12&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.12/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.12&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.12&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.12&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.12&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.12](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.12).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.12&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n\r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.12&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.12-beta08032257_1659592800279_0.5819734130134575","host":"s3://npm-registry-packages"}},"9.2.12-beta08032351":{"name":"dynamsoft-javascript-barcode","version":"9.2.12-beta08032351","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.12-beta08032351","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"4eba9bf20479a2d98fdda7b9f43bf8428b1cc48b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.12-beta08032351.tgz","fileCount":65,"integrity":"sha512-olQu8tJSkllvWtJtZ0cVYXG8BhScfj31svsZtOw/2Xg27F4F63/9Cd+UtfgrbKRYUGW0M80uAv9EWc8lldzT0w==","signatures":[{"sig":"MEUCIQCxnKJ6pLhuMNa+7pYsvXQc1dm0BYi0phWkJZmy74ErwgIgSB68gGQ7IlaX0wgBwCRqHZ8KNyV5ro5gnf0QFsLFTas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9385952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi620TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpO1Q/+OXyOZf1b1zspeTV9ARiJyLhyP2QmFc9VG20qGXmneVs7uPf6\r\nRt4zbtp2MIC796sh5uNzuNr+w3I0OkK8TvNsw4/La/h/QFLSceAnNz9odN3C\r\nt6FTpWiL3v3xWuSmgUPeIDe+HhgoTBThRW20vHwxTmBIRMSwdcce0vdPa8DF\r\n9+k1Byz1FGGtWTqKKJeaDxobWZzlm5JFVhvIbBJZsmYftiRmIIyFABvjkW42\r\nnmg7E5d3jKL2b1rTUUr0XNXX803m8UmvxZ5amu2VfQhWcEN81tcJ63JI8+To\r\nQRb+VkkA4nZ1oFMOU/P3EqGgsiuZCNO4KRjCaSD5fsQlQuJz3yxglBF6D7Oi\r\n/K58PBcjXtDQ4kgi2qLngspDKlpYnHtWOc9PCdyxu/UvTUXi4OoNCmyTLCvP\r\nNAlkIekJ2HjiT2g5s0pMbSHwxVaOM0inPfLGIAPki1Xli7P2HI8HdjejYogB\r\nREDvxNWGbuzu2RDGMLP2lmAuVWtHiM15Vg3v+OYLr5bwweSB+Xww7hCzF8jB\r\n/wJ37oWWPZH0tsnmT7PjZn4pDcEdqEBmP9pLxBQYj6mg5edda/yQi/ZoqvOq\r\nneAd2nyRTRflDCRaWL1oe/wVoyudGJBWssl51A2JnIew+U3j4QaRBzeVD84F\r\ns6C+VC8Pup5PfHG58uUXdVhx899a2VcOMWg=\r\n=aH8j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n* [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n* [Building your own page](#building-your-own-page)\r\n  * [Include the SDK](#include-the-sdk)\r\n  * [Configure the SDK](#configure-the-sdk)\r\n  * [Interact with the SDK](#interact-with-the-sdk)\r\n  * [Customize the UI](#customize-the-ui-optional)\r\n* [API Documentation](#api-documentation)\r\n* [System Requirements](#system-requirements)\r\n* [How to Upgrade](#how-to-upgrade)\r\n* [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n* Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm)\r\n* Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.12&utm_source=npm)\r\n* React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.12&utm_source=npm)\r\n* Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.12&utm_source=npm)\r\n* PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.12&utm_source=npm)\r\n* Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.12&utm_source=npm)\r\n* Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.12&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n* Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n* Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.12&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.12/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n* Basic Requirements\r\n  * Internet connection\r\n  * [A supported browser](#system-requirements)\r\n  * Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.12&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.12/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n* `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n* `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n* `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n* `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n* `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.12&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.12&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n* jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n  ```\r\n\r\n* UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.12/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n* From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.12&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n* yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n* npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.12/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.12&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.12/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n* Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n* `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n* `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.12&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.12&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n* Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n* Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n  \r\n  > You must set `defaultUIElementURL` before you call `createInstance()` .\r\n\r\n* Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n* Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  * Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  * Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.12&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.12](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.12).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n* Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  * Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  * Dynamsoft License requires a secure context to work.\r\n\r\n* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n* `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.12&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n* `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n\r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.12&utm_source=npm).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.12-beta08032351_1659596051330_0.9506370871066974","host":"s3://npm-registry-packages"}},"9.2.12":{"name":"dynamsoft-javascript-barcode","version":"9.2.12","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.12","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"890e2ac30826ea136f0d2552b494d31fb7cbbca0","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.12.tgz","fileCount":65,"integrity":"sha512-mwfgkGTcKnbLZ5gW4OYG/zKKB8kiQP+mpBjviFbmJU4mtOcJkcHVF1Wogs5ReMAFOp79PvcRM/ztLRkHbFX/cQ==","signatures":[{"sig":"MEUCIE2mXKWDlUCpenv0Fb+m+tIRrPLTg5avtb9yZfRxlKJRAiEA8Z/RrvvjM2kS6cLsEflZOhbLILTnbgivyz/01kg7+LI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9385939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi63C+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKahAAiv1/tx1oE6uvlQE0QaluAke1mEgeyhyvNuttGUUC9Cgj208e\r\nd62l+fxYvJKjDsWy6RHcz7HYc4Nv+Fx170tDVVCRVEvcgyjSpM/kPfBoIsqy\r\nqtuSuP9n29KCGCpStJF9gAtzCMe60ePNa3EfMMClsBfzaPOshVsc30Ls7VbT\r\nk0enocgODtr2smyeLCG3XC2dxenKl3tY6NvPhUB3IbR1rpuizpJ3vTqshQbK\r\nlKEbYg04tmq0hw6xGKON5zDNxozWXQkC20wxB0/AXHmNYZrtH2ScIdZl+fFu\r\nWUqQa6MoK3upxJ17y71RETeWIfnuM9WXUT22FHxGzFfgxi3p9Q6zMI4llsFZ\r\nldr3J5UoTdvTWheniMpc7exmjlEAHfmwcuwmjBHJikfwK55dqGMt4MEbg0i5\r\n92il5YQXoh55X1rco6h485NS0nqBD3G9Zn8jmV9QWnsRYrNfZzByruGeXFfE\r\nQ/BmrqRANhNcwz8btO1wdQLYgGgr0fR/HEb/aMjIVlqsJOJqrzjwQdC2j6U3\r\nD6I2eUrq4ggBY0mgRfJ6/DGZgYwp7rZjFDtMytZmo3D6EsshjjvsExrmmr6m\r\nOA5cr+NIYo23nc+Nj3rr8Jz4nxvxI3W1twjnnygiopzPo6XAgZYeM5LRw2A+\r\n17rP+MJs+YTwYs7K6LU40OzhlEiLsJ2CNdI=\r\n=DMvv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.12_1659596990139_0.8763964875727277","host":"s3://npm-registry-packages"}},"9.2.13-beta08100131":{"name":"dynamsoft-javascript-barcode","version":"9.2.13-beta08100131","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.13-beta08100131","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"4b45666decf6a46ce30980d3679ea5879773f9bd","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.13-beta08100131.tgz","fileCount":65,"integrity":"sha512-e403zrOLeEkzfyaRKwK3ZxWD3GHv2u971jVgMQx9YkPQS2Y6uvnpJlrc/UhpIw9AqqIL7OZ7LBIVlVSYTyi/zQ==","signatures":[{"sig":"MEUCIHjrDWuEolLNpQtj98O0vavy961Sf0R4CtP6iw7vjoybAiEA9/sZUpCAxiEyloyPzP+eoR4w1tsQbusJFkx72mKCHak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9394595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi822FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo87g//Z8P+bWSGoz3NL38vFcLpYGJh8DVXMJ45X/0LnnCpP6POukmC\r\n+64VH+ypJ2ogKJV1gELzNqSPlFw95csERafgMjnTAjuCFBdtkvOEkqNmsHc3\r\nKDEwqfbUK4mnscilCCafkfhPZbIvPKPQU7KktXHzlMw2ZLjFMNkneGzB87hy\r\nT7P5UkM33Faig/+9wQvCUFl9bw/lLT1daCqcJSfCTXJZokFDMY+0pkeAhTFO\r\n3G+HTyCU2dNfRNfvh0Y/tQaEr6PpqA5W4JLclnL6xsYMzPkXCll7bXGt26vn\r\nG+VtaFENR8bMKO05lRaY2Nzh5e7PG8vJTnmrk6qxrBYmCZzf5Y3sg/C+8wHG\r\nKt/nWSH7S5910pZMJN0J2qmCeLH3QSPZvdsJTn2uK5GECZwdngsZ6LKiRsGn\r\nSq/PeYX7L1K/X7AxtdYFDKIdTqGh+DxGh2zWPFzZ6igKZvLJfLN9C6wqNNri\r\n/oV/GutbWha6i0+6LPGN0phEEAMPxW+coWByeqNeEtvxIjelhAGL38nfDM98\r\nPqMlJxbMq/7Tvom4igBfzPEwXoKI9VTSXSIAkg90aNB7vF+O4GZFTNXlsim9\r\n+GysiEEzhGHoMV4+7RbM4BEnCDg35i2ATVR/DvGfBeLOVCpAdzYNtR9z2F1v\r\nHZe65Uo9pY2tLGzNmrj4rR3ZPDxcJ6lJi6c=\r\n=5kvg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.13&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.2.13&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.2.13&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.2.13&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.2.13&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-the-pdf417-barcode-on-the-drivers-license?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.2.13&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/use-cases.html?ver=latest#read-barcodes-and-fill-form-fields?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.2.13&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.2.13&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.2.13/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.13&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.2.13/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.13&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.2.13&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.2.13&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.2.13&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.2.13/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.2.13&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.2.13&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.2.13&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.2.13&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.13](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.13).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.13&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v61+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.2.13&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/release-note/index.html).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.13-beta08100131_1660120453189_0.8872830759737087","host":"s3://npm-registry-packages"}},"9.2.13":{"name":"dynamsoft-javascript-barcode","version":"9.2.13","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.2.13","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"cd5424383a47182766623caba888570a77319070","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.2.13.tgz","fileCount":65,"integrity":"sha512-hUI2EyFBNdmzq3+5CfT6FogmfbZ2DNOal4eHiuh1zKRYXncos6xV7YNJraXwPqZVT5RijpdzqYp5/A/PFcU7fA==","signatures":[{"sig":"MEQCIB7ENDIR8D7lVaXOgQAOolAdxkasZLUbpH0576x6yZDBAiABfh5C2A+J2EXf7m/iEbTJrJ/pHuSY0E8c1TPz991OGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9394582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9FsqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAOQ/+PcQi2JQxOZNuqowQS1It+agbqgRB/+NhyEnM2XS0jHcMqn0e\r\nVZzF6NscyVOLjJDcBHhJXyxQgetTL019Sahun6FHFlEFkY823iMJrB6mFE1K\r\nbuVGaa0+JevOa3k+Gs/E55G8BwtKDM+sk6kxFNi4ZFpSE6KWHAKioU0Q+ZTg\r\nIZmD08tsaa4ATgFb9X4gq4nXbqdfzlCzIj2lt78ktytOdHP3fFW0FpNRMcc5\r\n9PIexHRxulLIGDX+DGrdX8x02bQLkCpU+cNgLaoPqx31Dc+qY5kwYU58BJsp\r\njy7+d9u2ZC2AoqrIdG6QFkthqGhRWvw00b7HlQP3yWxLmfoQ9ztX1rP0TRMa\r\npXgKOIfo4vimxKqbihjS6+jXlfMbw0arHS/OMFL5+STs4DfinllnrGS5eTbl\r\npNkQcqeNbV6m9zKevwA9PYdC/5DzPemkhOr0cMKl4RNUeME8uLmGil/r84lx\r\nvsEqNaSS+B48ePr2Bke02HcWEct39S0ioWKOZGycw8r5HAyA0VQvB0gz1iqx\r\neEr+3I9cvdK0bUwcp0X0pMdoA+ZmIyQyG6SGCo0le80pxG9CM5XSz/5w50O3\r\nTktn1M/vO5Ne1WdFevgNO/AFs4DpRi8cb6hp70wcJ1J7qHHwlF4DvatY0cr1\r\nxFRf5w2d/UW0Qr1pQ3aMklrJKmFmaDos5MY=\r\n=S3K8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.2.13_1660181290283_0.8042545167989092","host":"s3://npm-registry-packages"}},"9.3.0-beta09252239":{"name":"dynamsoft-javascript-barcode","version":"9.3.0-beta09252239","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.3.0-beta09252239","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"3216d1c85b6921abc6a8e78133f799dc8d82e8d1","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.3.0-beta09252239.tgz","fileCount":65,"integrity":"sha512-mClBJNoKpFpAybjIuPXOSbEqcEBOozJgHyZMLT7kcbDGYvPPwOAaguo8GNmADX4JTWPfKZDq9E/InLbnBpAPMw==","signatures":[{"sig":"MEUCIEXR42IKbTBFhl7RHYacp1ftch5hgS6b4IYdDG7gJTlaAiEAneax/A+cFqfAoyYOdeNq8qi/lGVpMFrJBpCwXCE1StA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9401089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMTu7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJlw/+MatnUVo457riQJ8t/Z2PPWI2/ikU0z5ZmUD1DL2jIk6LIado\r\nPInFN29bXzigJhCcmFMCppbE5ZdHdxdcR9U12frM00vyzczyoqZ+rmier4AA\r\nbPYPSiVkBAiz0XE7QNAdaN4xs+PUIFwe8WMxm1ssGLIHD9261IdsItPypyUh\r\ntX3b13IoG0ICRV5wHEDhBKbNkpX54IBls5eNvUXZSt0QY7lx5lp3OPXp0mfB\r\nBa2/kwAx5Cjl85lnbSA39pSMoFO6XY6EwaPQjJtR2r0Zs72wix9HqJ8Ud3/o\r\n8BJ9m8Smzm2cZiZaah38dmjjW2lsEW0G5Yb3BfCESKqB602atL/UKXHBlQIT\r\n64HhikEvf5lBV/D/vJbwukv4wJJqcZ3UUa3CdllbxCvOuCJNbzEEPhUKEpTW\r\nK3bC1EMWxwL91qAOZ1Ska9qkOp/EAgtNpt+vz6Qa9mSoWHTLF+EkdX2ASwcu\r\nwGMUMvdUuXlUkhDPqg9pfcUojvtDroTvHmZNT4hZlJUUbQf3wMYZD7JRN5Vr\r\nBFxWiL14uxo9bDOaAQ1jnAk7/s5ZHhHns/fmpDTeOkpabZK6AnqKAKCA4q59\r\nZqL/oxJe276L0areHI7Q3adJyfMVr8pKQLyb+cBq4b0GAr/3LUSKOz6G+Dfg\r\nKC9EquBcIJOqGnKWvqxEDek6I8Z4ZGF/5MQ=\r\n=AqZA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.0&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.0&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.0&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.0&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.0&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.0&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.0&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.0&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.0/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.0&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.0/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.0&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.0&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.0&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.0&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.0/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.0&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.0&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.0&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.0&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.0](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.0).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.0&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.0&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/release-note/index.html).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.3.0-beta09252239_1664170939600_0.5828496554256637","host":"s3://npm-registry-packages"}},"9.3.0":{"name":"dynamsoft-javascript-barcode","version":"9.3.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.3.0","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"606700a9dbef17c692ecb2508906f6b923c5c94f","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.3.0.tgz","fileCount":65,"integrity":"sha512-v6DdY6INZALHHj77AwW6cJDSkbuPgQOeMjaaLAsxjFopRFiiqjfIg0RBelI2a2UgiLunw7pra2McCkLCxXzPzw==","signatures":[{"sig":"MEUCIQDIo085KQuhgJE3VOOxaoJJd8fYL9RlGMUHfV5SjotmdQIgQ1z+Vd+zelk1kkQe30x9VRZEmPrkMMBmXepA+B3vEBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9401076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMlPUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUSQ//dVoz1RgSb3dGvaN0wZRceO8Q3cqN1fxxfdtVN6I0dL0o+bRc\r\n0D5ReZ2eUDmQMHu7FkmLNZiezSiOBWTAzzeEDH1d/YB8l4W5kXbKlnub0Rp0\r\nhUUT/3i8rsS4qv4qiOgNvtfiLIbUA/ObzwD7DFDcNFreNL2mlaU57W5DnkFh\r\nDQTr/L2s90prp2eBI0+a4/yFjE6Jf1JlhKm+BeV4nTBAwnWk9agNq3obkltV\r\nQm1wLavP1AIrrJBPADoEKhC1eOD0xWPWqIuTrphEK5rhY1zD/3YRiqhreDzj\r\ncgv2rB73i2UO9iFYthvBTtyDvmafYn4+FBQFf3N8Pn1s0xQMbG1azhZjSbQ7\r\nXBo39hBdPd6imbuTXkNmJqbYJ5lchU1qdMyLKuXAdNfY7D9Sqj8sPTO+jmlM\r\nqqIOjhxnZyJaiuwU0LyMoZ1z65kAbTCmXoq3xkxFvHuK3j+6ErBIeIuynD3W\r\n6W1Nkp6BGPqVVoAkFhnpxrYpgqsmlSSNhfPrPHprO+6Bo4pcTwqdWxwWrYnr\r\nhy98fAGRJJ/2n1ZhHV3l0U6z7TF8IMGJFhfwwpp1fgQSGoVlk1s7l44ilmHc\r\nu3kfdmOTrciATXcSV/wAm93xLaXB3/myuoFzSL+qntVGpz2nuDuiwmKx1RJ0\r\nIPF4nLUj8eA220fWnp8JSZnbksaLGarSSnY=\r\n=NFBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.3.0_1664242644446_0.2896985500315019","host":"s3://npm-registry-packages"}},"9.3.1-beta10082243":{"name":"dynamsoft-javascript-barcode","version":"9.3.1-beta10082243","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.3.1-beta10082243","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"58d54d4ff3ac226f16e9926ed7515dc72d3aded8","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.3.1-beta10082243.tgz","fileCount":65,"integrity":"sha512-Q9f0lpCZkRy/OviuUT/1ZGwNloxyYG2THCbjB44pVfJX9r9DU3WEjqhnDm5wusa7oTgTES5Ys6y2MBAR/sZ9UA==","signatures":[{"sig":"MEUCICu44ByR0H8ILKdogBwqwOkV9asEga0GuU/Nv546w/8YAiEAkWn82tzbNGAAcQxAZlMkzJ9rwmZGLRGiFR411PvBEOg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9401842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQmASACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohoQ//e2EYZbZl90pwaqKXMpHaM8l681HbGoZg12VCDYPA/WrqndHp\r\nr1LsL/YovhFKZmySTTve2uEUORnlBRwCQFkfQLxWHKCxjyqgfZeKXXwf10Jo\r\nrbKoWCwnkY3H685BIMvdie0D9XcFV772K3yUDdigsUqjjaqLv7Sp/PRC5E/y\r\nj5hRvTlBC0l8yxUOPZd4a5oHH3TFWTCnnQvzNjHlQTqpmdSSkLGwpmN2ucVI\r\nXpAb241lu/Sdfd124SG58YJTrjmgy7aCZCkksFcgfqoV6+XfK5rO8Mz9JQXB\r\nmLxpyRx45qn4kr01rfetFeAx29WprrdyS7uDeEbgY+lmaZfcfuCQVtUFsEgI\r\nP0Bvcot63eDFNrycZ0ilWOm41kq1hWjDajjdAULEDNsLOO7q1GQWYxOuzEAk\r\nbLwzBEZZb572rg2zC2BK6qtSzmqG1L3M6XjsxjQjmUZOSNbmz6sKhPBnHl3X\r\nL8qXjv1qfti0eK8KNVNnb5AEx1jfEKhaTTKGshw5L37ytsRAsi14KbSVCmFl\r\nKDdrCK2JpdGxMUnc02XQJILPE4/To+R/u1w1T5n4UEGdKR9M0hSJ+ec4GIoQ\r\niSOwX52v0zLQTwYFmbcP0BEY/U07oZS8o/N3r1kvN4tY2/xUelZ4+0t8/J8G\r\nSyQ3ntrER4tyl3MicO8Rk4vE8GBUXxmVohc=\r\n=iyt6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/release-note/index.html).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.3.1-beta10082243_1665294353936_0.13766454779879922","host":"s3://npm-registry-packages"}},"9.3.1-beta10092217":{"name":"dynamsoft-javascript-barcode","version":"9.3.1-beta10092217","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.3.1-beta10092217","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"a118dcf9f88f932f5a34c401301dbee7e8f7733a","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.3.1-beta10092217.tgz","fileCount":65,"integrity":"sha512-Ik5hflt8RzMgJ9CbGRCutwU/ulMWf4a8Wpr529D1ONDfHdocr8UwBR1YiqQ6JA5qZyg/MbkvJzdUZK/wYeAIbA==","signatures":[{"sig":"MEUCIGrkidenIzBJ0lTHC68bvX+4pYUiw2QN9s+jkwojUFDOAiEA5pnBTtvptjVfad+L3Mr2R0eU9JsE0jG8BcanFDCCiH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9401852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ6uNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofPRAAo17YqVqVyvQxSnUE1MnkjMyAIetuQDMWTzAdAElyeOLyKk4e\r\nuaIgliR0rppDZBNXAS2FiCgbjGDSGyc2M94+Ej86036IDVCh8Fj10voCXGwh\r\nsxJweGQjzYmD45VRqLSkObYc/9Oxo3f1Trn/TVrm5iI8cS3oOMsFOjV9Iyx6\r\nxbO6iZukApHqOkrly+/sztMuYRqh/cJcB2mETrEzc3k25NaaUjDnGijrByUw\r\nOrXTOfFrob92G4IJ87O72ZZaqMrEFpFvkRRaWmzPkatgBPblHDQZd2axE61f\r\nJAx0F4LHO5BvI69AZ7WMB+3OCIPowA37GEDdtH4uqGqjU8W9g4tCj1KpUo5x\r\n6D3NH8DGQlCxZioXcr/KH5ZRr6mkjKVqypPxtOECdb3FoD3Swo2RUghM/cLZ\r\nK/Hfr795md4FPL3jsBz02ynaTIX06NeqX//xPWkILay6dwLSK7fDH2zrL7Tm\r\nEANOwbWYyzQfdn87jsYYgOYDTATM3uEDhlUmiZHOGIOLlpjdLhDFD246jXQM\r\nqrjNDBjUjlNENQMHQ7+QI3BZiXazkptiftSLfruI8bTIpWzTez1H0MO4NOOC\r\nDq3HFM92Wh0Q+R45/3slW1ahX5VRorgWHzV2EjYC4I5bZE+qOiN5OIknI1ar\r\npQllJvZIYhkcjd+gvu8bk3xE+0G8Q6xKuLQ=\r\n=+JYi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.3.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.11","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.3.1-beta10092217_1665379213589_0.36493018403409794","host":"s3://npm-registry-packages"}},"9.3.1":{"name":"dynamsoft-javascript-barcode","version":"9.3.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.3.1","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f66d2ad52ae7b2a550e78b104e43dacfc4509e20","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.3.1.tgz","fileCount":65,"integrity":"sha512-b+38vPGlPN2vq2tTkBV03sUpg8UAQJGnMJfhctZhIK30DPVDnu28GZWVUSHPqH0pTESJR+OxcsEmSz0sJ7S3/w==","signatures":[{"sig":"MEUCIQDi/51B+n7eFtyUYghR0m0u97DegnYxFNRfCS3Pxf4iogIgOOxPG2AXrHObzVKBG+Fub3owMyhZTt2CFyfMTM8H4rE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9401839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ7OCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpruw//egBrO6X4wQ6JfoHdft2Yk4Uy4qKGPZgtTbZJ6mIP98wMh/wf\r\niXd2u8x0tDqGuGy4nYNoDfAwCKM11z8fdUiGhQelI5uOsXBSFGEEdm5wq9LH\r\n1AkjTtST7jnlAB9F7DUBk7wElqwXRNt7nuhA1gXElJLT0ZyCM0M2l9J08NIw\r\naaibYTc7S6XXaAxZAIWjynQt/SjzXCCPL1TJImtDJTXVZRcdNMnMITZRYZvG\r\nR30TGYvQ3NU8jryCjTdC1IaoAZcvy6QbWAU2PeK6Ghdw7fQhw2xh8KpiM6Rw\r\nE/DQiQdPMmgiAxfBYXDhAKDGFINLDXVjX2lezovwzZvS8qjRHztKA1escvp+\r\nVkj2RRdY8QoEF4oThX5Qqo/qCWrj4eJuib+ydNio/a/ujrBvV6P9LC0VdCBW\r\n5UsUR088OJDJt4WT4jp0cLKAIbjbF05DDxYAIsVbX+lPJCXYXQ27w1RidYOb\r\nzUBqNkjydHXku3Yx1yI3u/iz1g47Ckxm/hbE905ZXcMwSg9pfj762PeB/ytG\r\nLmEuC6MZT61CCeb+FIfTFuzPsw/fx8t9xCtO7HH5ThSzLhFSujLOxigy38eT\r\neu7dNExYbVLLdHeC0zqdQQ2mYO9qepCd8Tz23HjqC9S/Ch7ns6jo1L9HqF/i\r\nnOwDXx/ywdcxfHTuZfLUMkJrrg8z89rTbPk=\r\n=7Fwa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.3.1_1665381250128_0.6894225857814389","host":"s3://npm-registry-packages"}},"9.4.0-iv11082257":{"name":"dynamsoft-javascript-barcode","version":"9.4.0-iv11082257","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.4.0-iv11082257","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"0e577fbdd7a856af218bd3cce9a97c1c3c5db7e0","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.4.0-iv11082257.tgz","fileCount":65,"integrity":"sha512-eWNdvDrHxjcc4rt0WJ0tiElLyMSDYWivDLqOJEd4bXadMmsRNwTFQ/9oG+JsQVYsta2OLlL8DmutRTE/s5MNoA==","signatures":[{"sig":"MEYCIQC+ZH7uPpQiLUYRjF5dMojt6awizLYJ7UlN4tg/xM1qpQIhAJNqc8sHXFbvQBxvUNMoP7qe4C0CvovwmbpuSPWpLIsM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9338099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja1DDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmry1hAAmi55PJoxMWyP6cpHp516+e/rHn8Wh42f4x/mcP8PMroFe5vH\r\nZvLMu5Pus1wzPNa/2GgzANKsBO8CEH77CZBQfW9nIs+pdQLop4ri6hSXlcEQ\r\nZxPDBcyuZlv9vbjC/3euI5Wc7I4V8FcNcgc/rVg8dGC2ytiCwjeBiUs+lFpl\r\nCUlq9wMhqIzDPKoPrliv76/IY9ags42bCdpS1PhI20Kjz6cYxbuTVQmevEdD\r\nVkGLbNNPQUlDeuCbQqSzj6GiONe2U0IaDiUPtlUgD60rtkhe7V5MBMk5lRp+\r\nbJbKsX3tjj9w0nzvRdN3pJ1+hU1c1VRvx0bJAIRKjWostb8CClx6YEigvsWN\r\nBu9MwHWvdTjEkEzL39CJlF6BmrHQgQebuIeZDnIPu09RVflE1GGXF07n9/VJ\r\naA6yRYRIrGupF5FnJMMT1pReCG42/XAOEnM8neRYi9pzoKHnY2YhVgPkofG2\r\nsAqwHtwX5UiiDjLd7rDojh9z5Jyt+aT9y9v2Ip2Iv3DSzpEtgHW/rkKq36xT\r\nGxHrBCoWHKBoOkmjdX904ij84xU/WxWqtDWy3h07geaRC999RW7ZRAAggxJH\r\nlbtIpaVdw8rBTWZfUdjQATZizoctOzEr4llMd1X2InIi/+n47y+nPYqA8jTo\r\nHms5OasPqIYOXCT8mfj2IeUuLLwAkelSiyg=\r\n=1GUN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082257/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082257/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.4.0-iv11082257/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082257/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.4.0-iv11082257_1667977411663_0.9852322575765176","host":"s3://npm-registry-packages"}},"9.4.0-iv11082320":{"name":"dynamsoft-javascript-barcode","version":"9.4.0-iv11082320","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.4.0-iv11082320","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9d806bbfa880da5ce26d5dd83ca776c3022c4649","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.4.0-iv11082320.tgz","fileCount":65,"integrity":"sha512-V0o1Vc+apU3fY3z5HAhsakTHS0AwT0fiTPs/tItfQJpd4HgBDwWYiVksy+6eMb4PXhgQXqHZaav0H+b/Pvvj0A==","signatures":[{"sig":"MEYCIQDLqKJLJDc8ut4Qdxn49EK6mDB4GRQvtINs4KorcjbSKAIhAOB9XkhVUQsw6tFN6fy8JBWYSta2yxpQxy4pi+DEuWWq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9338099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja1YwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6og//YHDJxUsLxgXnbbjZ1l9VJkGr+4EZ/Sm6QNRp6SXejYpfYBtn\r\n4nNlJMx9KkxX5bHul2jRRYIru3sFwqdSPUpO3CDe5xvnIUyKlrSEuy5pw0ic\r\nc04GPTkpsdZoLxXn+VmP4yjNPMJICnH2dnkdN8iOgG9P+qwbDFFu4ed2CLPP\r\nIz1DksJyyFecFfmUDQp1efOkUvUO3WLPxcJY6WfiLnkVStYJn4ReaSrX2kaJ\r\n4QXvRTDaXdcGmsKCtdUcuOp5BaUpe9XkWdnfqWjlfnv6yc7KE85okUPkqzeW\r\nnN7CwS82vKhrr+bB+jMl6VjvPinpAjshmV3/NXQCE/21voLragAoCRFj2ySk\r\njciLjwmfcVOxSvWve1yy/fQoOIbkqFQ1KCoCx5uDZYoH65YKt86y5BCbtSJQ\r\nLu0gsFzq1UIvwUDIePArNBYOkMlxsNnMntUFPEasHuNYI8tKmz2iUn0KVF8a\r\nrQ1D6zntMzl9dh4dCpZdGdCrFCcrjjrCup/ro9DZtIZgAfAZ4Stsd7AZsjxN\r\n1pEMyrtbgufXAbXF7BqFJG7YatN+spm8vtZPtJEkj+6NiOjp3S5C1vD9zKFe\r\n7CE/vHQdMiCl6PQ5c1LYwJ5oUlf64mAZUJDeo38WHYbRrWW1Ba8x0IPXlVDF\r\nengig2vcV859e3gY+MfjV28EyYxxiOpDzFw=\r\n=qDAU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082320/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082320/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.4.0-iv11082320/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv11082320/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.4.0-iv11082320_1667978800318_0.8289441144152199","host":"s3://npm-registry-packages"}},"9.4.0-iv-202211222141":{"name":"dynamsoft-javascript-barcode","version":"9.4.0-iv-202211222141","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.4.0-iv-202211222141","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"21b00e1e1c495e808a1cd65a6908e2b389ff68f9","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.4.0-iv-202211222141.tgz","fileCount":65,"integrity":"sha512-KRWQwHiwedpHD50yyCaCYV7FHU6+mphHr4836PBquJyc/kRB2kYIACtwsP0kzYubWKFAvzE4pSovP/B9lg9wig==","signatures":[{"sig":"MEUCIACy8gKj4/0/FeHnKw/gfz9CkY66ovQXp78WKSpqFl2xAiEAzI907v+Ns0x1UXFVxAt1x9wtNRJ/unCMfWUEhm3WNS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9421636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfbOiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtixAAnXPfN8AUkagEIMYxQGv6k+sbB4qLbmLKm9rk4RzEVHQXMLzX\r\ncb+0dDEen/yfIfqiPqAitHpN+MffGeJU9jjFWgADUEeqXpDykdnD+rOkC/Ei\r\nclz5POX8qF82aWGWqDheZ20csHyg9uJRe+U/GErrS13FDmQ9K/+cxmKK0JIB\r\nnpq5Pqz7BbD57Q0/c+Au8R9KcRQBXgCqlKm0pWXYyKvvasN5wLha4I3yD4wr\r\njPWWHU+tg+4N9Cp5tLu8NY/LAphuh9qnceP8ELaYiGHDRzThOB0EDcvRjXrY\r\ngZFKPcBHKQcMbIAJ50a5nWYL6JkRCzBFAEomTJgJiXHWXN4t1Dr1DMgr3T6X\r\nwVsHxC6oRB34hs9BU3D9rUnY845NcjF5UbR1BZgbgnuFadnTdDdt6HcAxkTc\r\nlNouj+tAmnWTNCL8uG2uBtVY0QDqpXc35ztrM5mJRU19Tds7rdPP9hmdqYbE\r\nBRThZUkdXFjPXlmgfijh9hrAnRMSvmrHt4LeUf1AVA5DE+qPbY8pJaopCh+C\r\nnmwUzc0pEogRcY7SvMMAPacQrPfQ/8p3sTiQv1D54l65xm1Nl/CdEmrod1YU\r\nTTYucpoPrjCwPvGbjz4cjz2yZBCDhcqUPVLsKNPJniJ3zAH1xoXPqNccUigs\r\nsvwH0Sb7tWazuSzEUFGt6BYGAh7JuWneiaI=\r\n=K4bm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv-202211222141/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv-202211222141/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.4.0-iv-202211222141/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.4.0-iv-202211222141/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0-iv-202211222105"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dlsjs":"http://npm.dynamsoftwebtwain.com/dlsjs/-/dlsjs-1.0.22.tgz","tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","typescript":"4.3.5","@types/node":"16.11.2","dm-browser-info":"http://npm.dynamsoftwebtwain.com/dm-browser-info/-/dm-browser-info-1.0.5.tgz","mutable-promise":"1.1.13","@types/node-fetch":"2.6.1","dm-curscript-path":"http://npm.dynamsoftwebtwain.com/dm-curscript-path/-/dm-curscript-path-1.0.3.tgz","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@rollup/plugin-node-resolve":"13.0.5","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.4.0-iv-202211222141_1669182369847_0.2396522282599054","host":"s3://npm-registry-packages"}},"9.6.0-beta-202212130059":{"name":"dynamsoft-javascript-barcode","version":"9.6.0-beta-202212130059","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.0-beta-202212130059","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"2cabd6a8537bb1b71b1afd43dbf4ff61393966c4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.0-beta-202212130059.tgz","fileCount":70,"integrity":"sha512-Va0TTIPZxuKWgmO7hBaXgiECFEc9DQ+FBHr/AZ93+MiJc+lcztyi2DRul9tztNroWcLATdWjUcmsQRPn9YcgfA==","signatures":[{"sig":"MEUCIAYSq7I75QjoFmmfJhpQewsJsvteLUsptFFqt/MOy9T2AiEA2Vsz1UxjQRCu67p+1pQoJ/qTWbr3c1VULEvtlPSim+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19087753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmEB2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrzag//SMKH3yeMBR+J1vgG5i2nlZhzKj99YJ/k1pG7OQazOUM216DF\r\nE4mprW9ThUl5n4ob+rWR/H1VlJ7r7NhCL2A+fX7p1pS7icdJ5KR+I5vwdSVB\r\n9Dpxar9TYz6mmiH4+GJxj2vPFhCHy9A5vcMtqsE2h8DIlTCVc0FrDG7A6KcX\r\nsLYUCBP3UTLxEVJ4OngJFLxH5OQCVwcU3RRY0IyHIbSIuq7naKV6wSMWHtjS\r\n7ZePBjgqCrO8t6wCyrznmxnlMnkI3qet64cjISdu1YJpbZ0rK4D0eIChz9+w\r\nB95wNCAxn3ZwKE76mm0uRpBST+tHqEA8jtcz/ZAGd5pU7V720HwtRXXUD1KG\r\nPF9P1y1U4wmUhNBmPVAQ+7BB0CLLfDRdco+k2i9cnxIK5VmL+85hlmXH1jgb\r\nPyE0vMGjF0qXZ+7WbVUusYLDoBcYuIgXvpgpaWUryzz5elwhF3767OL/fypo\r\nYa6b0Y02v3Hc0QhuqR7Ayi9LMBnMAkhLSATCQGI3Q4QTOLFdS1j3DE9rU/qZ\r\ngaz2FmtwdwRV9bnH/DYOBPdQDA3xGhFwMoICF95BEMsCvH1RuKRs6lomJ3iO\r\nmOoapwzczcqFY8Ch8N69VB5y0X85mZYVJNgwDoO1oTGVDdRNfdMcpjYVcwqk\r\nJ/HhA1kz+RIUdCm9HIWJ1Y6BY2SI/HQObbU=\r\n=YBLF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/preview/programming/javascript/user-guide/index.md -->\r\n\r\n# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a CDN](#use-a-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.3.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.3.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.3.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.3.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.3.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.3.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.3.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.3.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.3.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.3.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.3.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.3.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.3.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.3.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.3.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you registered a Dynamsoft account and downloaded the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you and put the license key into all the samples that come with the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=9.3.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/global-interfaces.html?ver=9.3.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect when it is put before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - Add the camera list and resolution list\r\n\r\n    If the class names for these lists match the default ones, `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (3840 x 2160, 1920 x 1080, 1280 x 720), are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will then use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=9.3.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.3.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.3.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=9.3.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0-beta-202212122121"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","inline-css":"^4.0.1","typescript":"4.3.5","@types/node":"16.11.2","markdown-styles":"^3.2.0","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.1","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.0-beta-202212130059_1670922358166_0.5104297042726693","host":"s3://npm-registry-packages"}},"9.6.0-beta-202212130149":{"name":"dynamsoft-javascript-barcode","version":"9.6.0-beta-202212130149","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.0-beta-202212130149","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"d0dabdc80a2d725f6fba685c16572b72ae06a9b3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.0-beta-202212130149.tgz","fileCount":70,"integrity":"sha512-uOIbuYoQ0Q5pOS4sld1Ratw/4obEbTm4N2eX9qPicX2mud0eZECW/RkAcNApCk7AWFh799L8tkr9dBgzaJVPQQ==","signatures":[{"sig":"MEQCIEOmsTzHS8gKvWkiXLuy8BdPrCsqEY2WX7skB1UOt5Y/AiAmIqMRgo4uW75OOUFFf/UaY+W+rfX4SOv/2v2j8iFJUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19094947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmExJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGGg/+PTpNSwZdXSvQN7SWsCCa3JfxkNQwYv+Xl/gdtgo4I3eMpPAy\r\noFRcuwDTresCEmCWtKr5PIOW2CC+Rc47OSrBWt888VdgGxveazNdYX1+pAGS\r\n6trOCrsZN2bkEB2nklzV1mj1+segSn1YvLGHPNmP9eDsK2KhyaJY3lEXca/F\r\namsOkfGjvHtdGl3LhMjm51AZaMD+t4qbag3fh4lmCidgI2DxA5d/Vhf6wfF8\r\nAowrxk1WhOgqht0G/uvbVWag8x7Y6Xur4HsrOfe4CuOK3H02xVSsWFSnmBIb\r\nAn/IcPuNUOvSU1UEdDZ6/dhFNo5aIfdx5IhKyiS/IV0H/Vozj39i75qElo/x\r\n3iGmXnAXW+sKHknha2O5rj3ofUABOxp/8m0WNs5GHgrFAUf/DcJuEL7Go7Sm\r\nPNOEb1fMBXZ2Dwfsh2q+yO3FzeMTOVYAyvG+/iodld8WPvoREpsGOjWFx5AA\r\nEX2baqiaK2XudioDor5xcNpZwJkDjkVjpphKkb1tFtJwoIoABTKftldbOBdQ\r\nqRdbQ1vre3GYN+At1SmCAIvj9+6pA3dZjIbEYjGEvzU+GylcaDIXTL3CvV5L\r\n1kw76YUilJky3neerI3MI2IXn9mMAZefFsv6hcJMyqnLczjV2Gt/SufE7mkg\r\n6bgwMvIJB30KnzVQjLf1Y9Jr2e/C9yrp+14=\r\n=s5aG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.0&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.0&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.0&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.0&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.0&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.0&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.0&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.0/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.0&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js) for the test. However, please remember this link is temporary and DO NOT use it in your production application. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.0&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.0&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\nTo work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time to maximize the performance of your web application.\r\n\r\n```cmd\r\nCache-Control: max-age=31536000\r\n```\r\n\r\nReference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.0&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.0&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.0&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - [Optional] Add the camera list and resolution list\r\n\r\n    If the class names of these lists match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/ui-customization.html?ver=9.6.0&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.0](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.0).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.0&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.0&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0-beta-202212122121"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","inline-css":"^4.0.1","typescript":"4.3.5","@types/node":"16.11.2","markdown-styles":"^3.2.0","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.1","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.0-beta-202212130149_1670925385618_0.4851557148614756","host":"s3://npm-registry-packages"}},"9.6.0":{"name":"dynamsoft-javascript-barcode","version":"9.6.0","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.0","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"111c0f8e6bfe2e731505f1a00b084bb363fd18cf","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.0.tgz","fileCount":70,"integrity":"sha512-HmpyxFEr3kJ9Ny+UZRa1cjPefR9duyQ21e55kOmjWyaB3CRIoutK2u11w2k/PgIWSXCwBeGc5iUvgecRXB8KoA==","signatures":[{"sig":"MEQCH3odWx0vc3LDMfBN6O1SOgFQ6Bcpi0GDm6BdPZJZhVICIQDcx39EAyRkAdvCZN6MGUinNdOzboFByRWTFFkJCBrEhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19094911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmE6RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYgw/+N5UpD2rnBtauM3UVlWCVIFgjk1JKbxM5eiV5z9wRIq68f7YE\r\nceBHMmEzzAUd9uEYgwhOD+YWJrrGZNXPqOTsDgfjvSL4AtMOZ3MnX4PxBGUh\r\nGvOPSzzpN3D3E3yN/ft/5bBmLH9leiGY+s2kFRP2bI9/yorkizNaWOMSvxIL\r\nwuTSGPs/8+629cmLXTqroKYjazeVZH8JLZt6rjWTjwQoIxrxj7n+eElR/vSY\r\n4JI+SayZONTbei4LI+tiWQ3C8LPMtY6CtYEijhEMKRdEZ7lH6CAyHK4GxF4L\r\nn5kHMvJTRme0kTwgCdhGXxA2cB98StPb+SKXyt+9hz3YZqtHO3p173s9+CGi\r\naNNfUjA04Qn+WTZ+82Rd3sI4hXCQFFWEAqc3ah/CEv8VDzQCCCMDEFYMSh80\r\nJfSwCh3gD6DyrfIasOfLYRf1uucHe2JECJ4HVSI51fcK4EG+CmujWeZp83X+\r\n5+KPDsBL2+STRTitAznbKEtY+g1rl0lymcEyRotjQFV7TZ6aeRxLmag2IRb1\r\nfgSVnanWeQ60TMdAXCu4/Okg9Xz+TWQk6BnMelMZqaD+39qa70W35VgxHa41\r\nZQC1MXeiAHljsnF9N48plL3R3SJbUpDK1cnnl6lJX9OBIrLaDVcQaWKwHaI8\r\naiUFy+fIQDux0hmA9YImMYtLFRVb+3JjRKI=\r\n=mBkl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","inline-css":"^4.0.1","typescript":"4.3.5","@types/node":"16.11.2","markdown-styles":"^3.2.0","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.1","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.0_1670925969293_0.5796387749814031","host":"s3://npm-registry-packages"}},"9.6.1-iv-202212150202":{"name":"dynamsoft-javascript-barcode","version":"9.6.1-iv-202212150202","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.1-iv-202212150202","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9b130221aa1afca549778d0d320e0812f606a3f3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.1-iv-202212150202.tgz","fileCount":70,"integrity":"sha512-Tq8hjiETWfKgRH9DUdLIedBGQ/4HFKov5iXyTFX9+I/hCZZPbFX1e3q6LGM0f5wXz6midBVHo8c6bI+meZy5kw==","signatures":[{"sig":"MEQCIEwnfKV+zkQoSHEh5lyEOAT2aAJjeWnFbfW5YwpaCsnuAiB3B2lxPMaru9dswfdS7wK315ZSbYnS6yIF7+8R5iYLTw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19032257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmvJcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxFg//X8WVFIOw6SEPnXMfT/T7IH5bLr/iPwQTECmuKwruRcqhMLCh\r\nx1r1S/+OnHejWr4pvdjPqRT4Ek1G5QV2ovc/unzZIwIy83hvWDTZBm1nxxzx\r\nm9PYxndXCofk5aa06uzQiXEGxpPD2nbBq/biVJsqvUSgBBOhq3Aa/vILYin1\r\nNlYn0+pSBDGPsP+opYwBu5miqLTh9Lk3hDrfjQppPAVNj+0tly00hc7fmBLg\r\n0P2fOsxJGNy5wfg6MLEih4S8Cn+Kjsh8iWE6PD3+VvuAFiC5sOUaU1eqsPmf\r\nNqdckmlj0z6LI0LZTihM827sFt5YvfH+AxMjU24Dhc2gXuJfDG09xQXnSFFA\r\n4notYppKDcSK+IpYI75w1wpNsy85SXSw22ZVs97mrhjhrhx60TSw31iSHzhr\r\nplSqg5FebHbjU4RNhhzVeMBNgHs050FHbgmGtrpUmK2uXNyo0EEf6AD8b1cs\r\n0CDle16vMHjTk5/JuLqf3IAO3/8u5gq/VfBf+aYHXXxJvElC8GnQiLyGZ7uO\r\n1x+W4j8bV0zA9aVG9MB+Td0Y9GMG/KAoi1c1YV4W6N40duoqVjCQhxbrgbi/\r\nV6+5IuQoaNDD2FH1ulNaChuZZyDNLJEeoWeZLuW9qQuk03bd64glimV2lViY\r\n3kW9nIqMaCN9Pr8tFjOb1ma8jupht2eph4E=\r\n=KJkm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.0&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.0&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.0&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.0&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.0&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.0&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.0&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.0&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.0/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212150202/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.0&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.0/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js) for the test. However, please remember this link is temporary and DO NOT use it in your production application. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.0&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.0&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212150202/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.1-iv-202212150202/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.0&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\nTo work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time to maximize the performance of your web application.\r\n\r\n```cmd\r\nCache-Control: max-age=31536000\r\n```\r\n\r\nReference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.0&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212150202/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.0&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.0&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - [Optional] Add the camera list and resolution list\r\n\r\n    If the class names of these lists match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/ui-customization.html?ver=9.6.0&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.0](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.0).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.0&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.0&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.2","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.1-iv-202212150202_1671098972549_0.44389824444788006","host":"s3://npm-registry-packages"}},"9.6.1-beta-202212182159":{"name":"dynamsoft-javascript-barcode","version":"9.6.1-beta-202212182159","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.1-beta-202212182159","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"cfe49607c45dac72b7a5ec79246e7e485766e856","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.1-beta-202212182159.tgz","fileCount":70,"integrity":"sha512-uxK40wqKnFh4imec/ljSv2CTywBNOpPhPEX9DF6r/j3X4SFLu3guMeKBX4spm32hlij2d4dRbYHRdPvNC6h/Nw==","signatures":[{"sig":"MEQCIAa9Eneem9MXrvXMcptfYINteFJTani2pbZ8r5sdGmPIAiAHZjvoVr4IxopgCS37CFu0kVFeJv62L3MtFNv6VODGWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19032131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjn/8oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1DBAAmw86dYYCY5JbDgCS059/LVa9M9jHpIZ51gWI0NoOOoim1+OB\r\nWcO0egws4cL/otCKkE7s1DdtXa55D7iEIbAo43TfeP5/pnZ2w3TkLS2aiWpx\r\nSwNxOcpPSvo7o3DJc9iHTXVcuoKn4EuLLA99zKXZnI03dTUnZp77zaC1YlJw\r\nb+Qq5tY5mBaPtViy8F5lgcaWYZiKSTuqRWqcG3qPijtePpoNZHxFSwKRm3zP\r\naYjGGKbmadRhTyXJPwtfdOmMbAiKloBN7MgClmgg5bpK9JvL3Llpfc0tTiCU\r\nPk+0yQ7/tu5S79Ce72zKm/Hzr1a+UuxVscutKigoTSgfIP+Cm0FKtqLk7X89\r\nHQfbevTt24mdPTmviq5rmdYeiUFPpTEM7IhL3mADLP3Ad9tJrpiwnDgorJKM\r\nZYVTmJc1wcZyJ/xMRrkNHt1tEdJrgcR068k/aKjmQOLnjzla47HaAMsAL/0h\r\nyaCATt3j+14eVm0Tuzsbx9iq0tnaN3enXDSvjddf6icEucPedlz/to0cMjEw\r\n2bkBzhMxzYIqX1HhjlQGi8BLiCF2NB2VCryADfmhyWz/Uw18NSUtmUobtYvi\r\ndY2ld0ZHj7fOT04KH1OlaKxoEhhBdK/4xAd02w3/szyLfSTt/5JLRvGCYHrk\r\nSBVCMltd+KFgdc1vO9436TbLkY6EO5bNqFY=\r\n=pdZ/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.1/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.1/dist/dbr.js) for the test. However, please remember this link is temporary and DO NOT use it in your production application. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.1/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\nTo work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time to maximize the performance of your web application.\r\n\r\n```cmd\r\nCache-Control: max-age=31536000\r\n```\r\n\r\nReference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you host this file on your own web server instead of using a CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - [Optional] Add the camera list and resolution list\r\n\r\n    If the class names of these lists match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/ui-customization.html?ver=9.6.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.1](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.2","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.1-beta-202212182159_1671429928669_0.8978844556504899","host":"s3://npm-registry-packages"}},"9.6.1":{"name":"dynamsoft-javascript-barcode","version":"9.6.1","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.1","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"4139cc27f3593598579a2399b33df025fbc33ae2","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.1.tgz","fileCount":70,"integrity":"sha512-wAaCrihkiX7YudisJNUMy21/jo5BJUqIc+mW54iNeJ9I4qDowfYA07uQEfw3XKCNUVRE50rbg4zGQIaH4Cb06g==","signatures":[{"sig":"MEUCIGQ2zil36OLTCNc/s+kBdsSe56hCXy65V4yRBbzfT03xAiEA/sz3xt+hZH+2q1IbYwJMkkQopsHIA4SwxWSP8VL00LU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19032113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoA28ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEqg//Tf8CIvtyb9AyAi1J7iNmAXSef6hRSG4LlD1KX8az24U2aAmb\r\n7IHs9s1cdY58lgKkfZTpRxJu+4xYJcFAylkBlzcms11yofCgDP13imBUl2Xs\r\nf6nOMQLUMc0CLZDK7g0diqv4Ofs12OMXKs6X/nlVZxZeYp0YTtvNn38zFAvh\r\nY6g4bvG6CaptNyQdHxqO+V+94zmkEP+zx155uZkAoLaTDAL0up59fzeG47zn\r\nrHSryp/1tpBH68iP0/xzccWf0XVcl5jZloU4Vq+BR//n+GHCj3Ry9sh4m3Xy\r\nnCuRaj6YsYeUCdeOAuyfgSDaYHV01wPBV5iH22HL362jpPJO1b4v9VwiIzLd\r\ngYN9Py/R2OjghX2yFFm88XyJIDzVCif/ueTahEj0QlGTOWlL/VPK2v6qGO9b\r\nUyKCfZw92IyZWB4QYoEBcWqRfwjptY2s8S1qjfPD83VLDBDFjZINPccj8opt\r\nXa7KTqKVQJXSqvfxLgXpKbsKrCFnem6DNBLFb0GIkh9O6yH7f5icr4aXZqbK\r\nXAZSDVsmje3t2afYCz1IkjBpFTAdHa+wW2n6OhXtowrUMcXO/9b59Z5uX+kZ\r\nYGyiVpnpr21Kpio9Zee5MFUPVvUfhmM8dBFD9TsM6lwSKEw24nbu5aVpuVZh\r\nEgwnnSYTnfQQo9CU/r0jul16LgTakPjs6Oc=\r\n=1ioZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.2","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.1_1671433660245_0.27552104516478737","host":"s3://npm-registry-packages"}},"9.6.1-iv-202212230033":{"name":"dynamsoft-javascript-barcode","version":"9.6.1-iv-202212230033","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.1-iv-202212230033","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9d3e557261e6dd827585be8dcdd969961c79cacd","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.1-iv-202212230033.tgz","fileCount":70,"integrity":"sha512-YFQ+2akgBnAFKuoWxYpfkgz/zHQAu3pKCHb0Fjr7h3IvZX0ik2Zi9jXbLt9zXk9r10C86ioAWwuLV70mN6mpuA==","signatures":[{"sig":"MEYCIQDv6jFDftrdmFiwBJ9yi9EXCgWj3G7F5TVvQy7OSpWKoQIhAMICsMoC6N4OWDcQIxSpvvriQnsnIo+5xk++typkvVnk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19036588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpWleACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4cg/+OPkwKVo8mbVxCKl5UkF/t6MoVc8qDjG3ieH7kiknTA8wK8ep\r\n8s+wiZ48Q3k3KPyPOsslBNtxQulRJVBnPBeIJS+NK4mCX8LflPfHaq2w53ip\r\n/VTNadRokEt/P1WMuhIDeJemiJ4gqYzOlFkqmrl6RvkPKVTZ1MD/TCcASw5l\r\nvyyJzsnAFH7ykApjjJUCv8/torh1a9dLyTGcVzX5THHKgJmRYFzZ55+wPi9L\r\nyC3FU7fjt48qE0wpnGC1lGQTqndnC/f/nn6dW3Vgn9ZbEIY5bb9hhhLBuc0R\r\nICy7X65OmLArC7beWQIF//nLjerL9fVnDzY1Nh7tzILSyn0sz6NSaLQ9nwKK\r\nADbfiNnPvri2lCLIQ1o6w5tM29LRlBlnl1Z62GmIIoMznlIW8F8xTjiD+o0J\r\nF03nMOyIkuNuKoEm6TjimebHC9MyFPfG17oPKTwSH1iFQaWe2/aSy9svHCzi\r\nQnngsxGeSgWNLhSXhq4Ln1xeNsuLkjzmVD7YFYjn/DWJM3mj4lcJmLviBxEk\r\nBicDV3G//D0hXpPn6YypEBmayKuo6BMLNZwSZL838XOxy5G30NHo0WeTRrcw\r\nAd0pVdE5K8Jsw4L9XWttSVM390ZTyVfK2KWNaKOPD6MNZo15VxGFPKSZSMfu\r\nAEfsGvd07FgmC5ndl/ArKZxP8nJsCkkVfcA=\r\n=ocFG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.1&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.1&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.1&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.1&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.1&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.1&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.1&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.1&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.1/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212230033/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.1&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.1/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js) for the test. However, please DO NOT use it in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.1&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.1&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212230033/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.1-iv-202212230033/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.1&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.1/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.1&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.1-iv-202212230033/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.1&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.1&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n- Modify the file `dist/dbr.ui.html` directly.\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n- Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI.\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n- Append the default UI element to your page, customize it before showing it.\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n- Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`.\r\n\r\n  - Embed the video\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    <script>\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n            scanner.onFrameRead = results => {\r\n                console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n    ```\r\n\r\n    > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n  - [Optional] Add the camera list and resolution list\r\n\r\n    If the class names of these lists match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` , the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n    ```html\r\n    <div id=\"div-ui-container\">\r\n        <select class=\"dce-sel-camera\"></select>\r\n        <select class=\"dce-sel-resolution\"></select>\r\n        <br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n    > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n    ```html\r\n    <select class=\"dce-sel-resolution\">\r\n        <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n        <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n        <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n    </select>\r\n    ```\r\n\r\n    [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n    > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n    See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/ui-customization.html?ver=9.6.1&utm_source=npm).\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.1](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.1).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.1&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.1&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.2","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.1-iv-202212230033_1671784798584_0.20736004668480956","host":"s3://npm-registry-packages"}},"9.6.2-beta-202301140102":{"name":"dynamsoft-javascript-barcode","version":"9.6.2-beta-202301140102","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.2-beta-202301140102","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f29e5b9f0a58f167645660f4655b4dd69adf7f6b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.2-beta-202301140102.tgz","fileCount":70,"integrity":"sha512-LTx8ewKyvn/O1XIK/uhri8bZ4g6d268ljU7wUQjY9WHPWX0o//TjnfcNXJ+/omMSlqyDwNeVyTgXHCpCotV2OA==","signatures":[{"sig":"MEUCIQCgrMo2xAtGZxBIFumON4s8E7QgvbPCrtoEPnN15I73uAIgHLBpNErbmURJQvfFd8P/qkpDEDYELh3wRcnV/QXbEcw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19046690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwnD1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrivA/8D6cay3nqNL1D1xrPlgQRMft+PzCAxPA2SR7KqCBeoYQcM8tV\r\n9zoJwJtQOmn1qns9J0x27P/5u/B77Wj8adGRfyo3G1liBzsIaqxU1VaRWfly\r\nrrryUXDETT3HlCDncoGEJBQPQHjI5gTVWIxn0bcHfMLqMjNyu7N04di0vB9O\r\nZYP/mzvPoY2adxZ3gISrynzRIIYtk8n+8st6t43mo7SXFdSiYgbulRx61SiB\r\n1USAN9qo0agMCrh1fpsPSEDrYOl+V/XzlsfHGD314VBX10im1VabL/UPoAIz\r\ncgEMLdQTt0KkQIWPsPEX3HzdInAQyjTJX108E+GKMTFXTc+9e4M4Tc8+dDf6\r\nc24nyIedESZPyyeo/118YuIiYYGwlqQBy3RrlFYxV+j8AuD+hMn5Era3h9dy\r\nYd71nbLgxAkrDCXly187ZpWX+CSNL/tnHdsqsbLC7FmBOXZsYaU08AQXLlsg\r\n565glJg3gtzF/JOKscAeUh03N+LTO04aKv4zl6mnXGshl2ib9d37otBiQMJJ\r\nYJuy6tTdm9ecAviCoRZUnArE+td6CX5hJviHNQPOnuXOsAo/NHM+zk3sDGxo\r\nFlxC7c5gsixCohZiEb4Ls9dFmRNSD/PVX+tsS7r8xLfNOqA5lXT0A/+fvO3Z\r\n7ebeKULJEdnWuAgW/G/GkBc5IP0qJFo1+rc=\r\n=KNiv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n      - [Modify the file `dist/dbr.ui.html` directly](#modify-the-file-distdbruihtml-directly)\r\n      - [Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI](#copy-the-file-distdbruihtml-to-your-application-modify-it-and-use-the-the-api-defaultuielementurl-to-set-it-as-the-default-ui)\r\n      - [Append the default UI element to your page, customize it before showing it](#append-the-default-ui-element-to-your-page-customize-it-before-showing-it)\r\n      - [Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`](#build-the-ui-element-from-scratch-and-connect-it-to-the-sdk-with-the-api-setuielementhtmlelement)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.2&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.2&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.2&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.2&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.2&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.2&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.2&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.2&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.2&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.2/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.2/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.2&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.2/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.2&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.0/dist/dbr.js) for the test. However, please DO NOT use it in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.2&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.2&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.2/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.2/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.2&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.2/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.2&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.2/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.2&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.2&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.2](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.2).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.2&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.2&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.5","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.2-beta-202301140102_1673687285000_0.934520382222503","host":"s3://npm-registry-packages"}},"9.6.2":{"name":"dynamsoft-javascript-barcode","version":"9.6.2","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.2","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9ba97a6c25febdc5c77536d02469b70c5b80655b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.2.tgz","fileCount":70,"integrity":"sha512-bvIQlzyBQYl1lvoLuwoBSqg6uCOZ3pALOGeocwUbIqzmEMpfN7Y5Oxc3KZVSSsSART0vvCPNrguzCLlbtyRcSg==","signatures":[{"sig":"MEUCIHqpPHo2RdZOGIbnsu7btHfCfBwv5OfDZAbt2Uwa9N6WAiEAk3U0YoQ5OJtR2UAmgL+shu18kOusZ6YubcEWYjzSmv8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19046672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxOUSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJMg/+OyjBFNrZCpM/+XmnidwfYiVipdRJM7HWb6J8uf2SXrhZHiTH\r\nESCqkpd9r075iCVPfp0ceDOrFZhWOER0lvce0gHtSLQL3SpNuHZVH3JJpwqE\r\nicRBLYZi7alEvSacZ8kpqkFlrY6GsYzjjdNnbT3zPVD71J9h69Xw1qjnGSgb\r\nxGLfH/DVZye6RuCH1CQa6Hzbed4De+yPvqsIF1T1F4CS9hx8HbBmYfyMMTDS\r\nuOtOP+cp1IhdcdciWSbXuU//IyCaxhxvNRziG3tYPg9FOw+9ZloBZWVNgmsJ\r\nn2T+re6fiCnFYwgThJLuc1q3A0aaE9zc0Ag0Yehj5vcXGi7LrrwnbmFnMMuq\r\ncsI9t9+dtr7M7NPqGtxP+GCwZRgimAiDHs0FT/N48McB/tcKE1hPnOknLva3\r\ndwo1tQcrd4ChjS4l05j83c1jMO1ku+8GVdUY6ZD70HTEpITeDD89axe0SOp6\r\nGM3FoR8h/jfy8gH+Ih1AtcuIC7bSCVad7KDh5H0pvd8dn9d4OhujpAmCujML\r\nWBdQcnAvBoA9HwwGIMJ5aEejAl9eVEWwmaN0PsuT4fBiNRQa+NZ24sh5QpEF\r\nMOc3FD9jLxaFtjDtby80LDoe/cZT6prCEHiDG6gszwDdbL/CK4bN12LJteOR\r\n1FUMWIqu9GyFXAAlBtHyOva5/MR2cRLJP4k=\r\n=r2Zr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.2.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.5","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.2_1673848082072_0.3246518817404018","host":"s3://npm-registry-packages"}},"9.6.10-beta-202302201925":{"name":"dynamsoft-javascript-barcode","version":"9.6.10-beta-202302201925","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.10-beta-202302201925","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"2107ebfe3eb2331779916bf4dbfad0e596dca8be","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.10-beta-202302201925.tgz","fileCount":70,"integrity":"sha512-YYuoKPODgsQHHA3iMocFV06vjNlQv3FSUFkfaLAJlhCN0gerTQN3omQI1xyjCgwJYsrpEXoFbaKwBk664ogYAA==","signatures":[{"sig":"MEUCIQDONAR9+fjyPenz5I4fqaVLmUOhU54QczPtXyvUek9M0wIgOPpcNfqjY/ckl2r7jGDAOZrwg7ylYge8DXp7X66UWFk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19068265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9DsdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPJxAAoRHFgyfPije2cJkAWoJhJUg3uePT+nX4LRsykFFl+8b2vC2i\r\nhzJ9Q0IBLfCcpQbng57hcc4EnHOK1UgWE46wBZA7yNg6RtCQoKQbTwtZxaUj\r\nmVa6SVvHTXeosgjh1TzxrK92ytR6Tq+yRtbobq6k3i1hWguE865Yq8OFmpez\r\nsOGqE/T0ZYnbvJKB9gJNIdnxF5lwlDaBu0FtuKO7Q4TX6QtcjQIropuRPXli\r\na3NtIpHZTSrJVxCuE9iCXDd7dlblLe0pTqYLncUBzHcffhbU3boZMI4je+aK\r\nMyJ3zx5Lo/5tvxLlJDYvHETvgtNc8z7SWTvbjvprRB4P4CDNsQ80yuEhJ6PK\r\nUNqnZJL1U93FPFeU6HNYVM0jgjXJ0ZWcbEv83Dvk5Va3B1A3FpLWyUyyw5SM\r\nd/t93xSMc3G0pKO2DjfIk3LPF63H1tHOGCR3RWNQSLVLf6h/bjv2tI+3hYxm\r\nNmDY/PFBnk69Q0wXGFKxhq6xKYxCTBJF95/ywVzLNeoiujolSqCP0FfZxD5V\r\nZk78dCS8oZqWwbOGedHKVqa0mBMTZKIR9OPyugfPXPCGxJPk9tBYsyWE5Gfp\r\nJTCXubnI5/PbFH/B/NuzJvQl7CEIrmN/dba7mnTK+KFokgFxucAzEEMFZeC+\r\nB4MLE4qslmW8wjTgyH1hUhpRWKxrORmr0tE=\r\n=WSNR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n      - [Modify the file `dist/dbr.ui.html` directly](#modify-the-file-distdbruihtml-directly)\r\n      - [Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI](#copy-the-file-distdbruihtml-to-your-application-modify-it-and-use-the-the-api-defaultuielementurl-to-set-it-as-the-default-ui)\r\n      - [Append the default UI element to your page, customize it before showing it](#append-the-default-ui-element-to-your-page-customize-it-before-showing-it)\r\n      - [Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`](#build-the-ui-element-from-scratch-and-connect-it-to-the-sdk-with-the-api-setuielementhtmlelement)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.10&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.10&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.10&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.10&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.10&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.10&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.10&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js) for the test. However, please DO NOT use it in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.10&utm_source=npm).\r\n\r\n<iframe width=\"400\" height=\"225\" src=\"https://www.youtube.com/embed/j4gFtCHcCG4\" title=\"How to Use Dynamsoft Barcode Reader JavaScript SDK | Dynamsoft Tutorial\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\r\n\r\n<br/><br/>\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.10&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.5","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.10-beta-202302201925_1676950300924_0.21231817364042826","host":"s3://npm-registry-packages"}},"9.6.10-beta-202302202213":{"name":"dynamsoft-javascript-barcode","version":"9.6.10-beta-202302202213","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.10-beta-202302202213","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"d7450b263956b3b75dec064076731f8c30a49d45","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.10-beta-202302202213.tgz","fileCount":70,"integrity":"sha512-Xq5LTcaCpONljTt58HRnxYqJIz1QxLeBZ9P45BoWceSrDXUEvwkWhZQrXyQp3JJ9AYfvzmVAWKYbkSwyz6ax+g==","signatures":[{"sig":"MEYCIQCTsG4kUZT/kduB+tyRGvmMDLqWF9iJw9Lj3+NUL+9yQQIhALTBtIy5lwEdbztlSPmXTiWgFRlLHEuRGBsBR+ZZ/weu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19068040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9GI+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeBw//QNiD30wkN2aCkMeyBBcFTaIt9hexvhNV+JiTXiWcig3c1KDh\r\n1VBg5OfbRVVVJh3YdVnRf38X7k0dmPamGXLtmv6JHvz2CZQ9kdL6cO9SrAry\r\nQBPStMFyq51CcOVAvTouRtJnvU5lYDv/02rr6Po6i1xb9NeTd5ozliFdXWse\r\nU2itxyQkcEoFdwXSbjKgDQkoPPb9swtkkvlNjgwpKpzHX8obL7MGY9g6Me58\r\n80LXVL7bxl9fYCKpwGMq1xxDunyQwxNhYf+ffuweZGvS8U7SrBanogjnCsNN\r\nY3gulhjT3isofpFSwwvvT42gprcQuKXiq4COiwaAgBO4Msd7eKy1z/kRNRIS\r\nnS5Zukmal+g0r4E0mBIw3StKv2c/UAiWWRp961Ma3XVffi9MK2oPop8az+DE\r\nOLZyfuj6PnBGALXHoYdX8hwNjgrvA63UqVbByMW0GBqiEui28Icx7lcezucs\r\n8SrO65yxs3wxLYIpfsy3OY6purcAstl7LN4/AFFuDd1sVuAzxIPUBcAp3frR\r\nIMPlYx2cSaNyND3YQ4w4A8+LyWR6YPU6R3XxC9qPGejRDQjFNMLHzCF+tucr\r\nmsOcZEyDV42JhJPDfe1qyxh/SOqh/80ctTPBS6X0mVdh4SCyEVoO7fXU9olH\r\n75P9DQGa+zxqkFtPYgQ/+GkoBYuSTYHFCLc=\r\n=uj5W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Barcode Reader for Your Website - User Guide](#barcode-reader-for-your-website---user-guide)\r\n  - [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n    - [Understand the code](#understand-the-code)\r\n      - [About the code](#about-the-code)\r\n    - [Run the example](#run-the-example)\r\n  - [Building your own page](#building-your-own-page)\r\n    - [Include the SDK](#include-the-sdk)\r\n      - [Use a public CDN](#use-a-public-cdn)\r\n      - [Host the SDK yourself](#host-the-sdk-yourself)\r\n    - [Configure the SDK](#configure-the-sdk)\r\n      - [Specify the license](#specify-the-license)\r\n      - [Specify the location of the \"engine\" files](#specify-the-location-of-the-engine-files)\r\n    - [Interact with the SDK](#interact-with-the-sdk)\r\n      - [Create a `BarcodeScanner` object](#create-a-barcodescanner-object)\r\n      - [Customize the `BarcodeScanner` Settings (optional)](#customize-the-barcodescanner-settings-optional)\r\n    - [Customize the UI (optional)](#customize-the-ui-optional)\r\n      - [Modify the file `dist/dbr.ui.html` directly](#modify-the-file-distdbruihtml-directly)\r\n      - [Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI](#copy-the-file-distdbruihtml-to-your-application-modify-it-and-use-the-the-api-defaultuielementurl-to-set-it-as-the-default-ui)\r\n      - [Append the default UI element to your page, customize it before showing it](#append-the-default-ui-element-to-your-page-customize-it-before-showing-it)\r\n      - [Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`](#build-the-ui-element-from-scratch-and-connect-it-to-the-sdk-with-the-api-setuielementhtmlelement)\r\n  - [API Documentation](#api-documentation)\r\n  - [System Requirements](#system-requirements)\r\n  - [How to Upgrade](#how-to-upgrade)\r\n  - [Release Notes](#release-notes)\r\n  - [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.10&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.10&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.10&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.10&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.10&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.10&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.10&utm_source=npm)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js) for the test. However, please DO NOT use it in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.10&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.10&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.5","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.10-beta-202302202213_1676960317855_0.2895619648278036","host":"s3://npm-registry-packages"}},"9.6.10":{"name":"dynamsoft-javascript-barcode","version":"9.6.10","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.10","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f5d8058860f48d707d98dca2494d3e4ceeb21849","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.10.tgz","fileCount":70,"integrity":"sha512-kfN96rNMCYZHZiH7yW1n0PS/b0/r6WAt7DQHfVr4Z6AMECOAwXI1bgVJDbnBJ4vo2DZPHDHeIREWQTTu9jOuXQ==","signatures":[{"sig":"MEUCIQD6yz3TVGVK76L4XyDn6FB/qAbsukgpjsgCYZ766NLVFgIgfYM3xNQxjiatuzzoFP7ReAnjW2jrmMDQLXDCKGyUOsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19068022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9GeYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAvA//a+KwlE/kE/vaJMuFbX5p76gQkE8WDU6e7cgnIP46T39bUuKE\r\n2sZRUY9CiMSVx8sBax4KsVlxrEEjuefs9Ro4BZhnszqtXbfgOW4gDSMgyNTz\r\nAQnBbb2UR78F2prxe66yKI1uROleuieUvX+fIGqBa/5gW1IZ1O2Dxqn0mYER\r\n5pEPQGPFCgZBMscUiHznWFzu1+DXmi/B+Fg/tPiwKJfcZaxjzj+ed/SkI34S\r\nWEpNBQp+h2euNqYKbs1vICiKTIKwePHWu6x3hBR17ikS7Lwx8fyPCCb80ArM\r\nXR2ef7W18iz9KFDLAwU55RftD8bnfMxBh21WxwnWru49ZjC4JfkJeofhuYez\r\nUbiQyzulc3Dw1C9gFmkwMY0bNYIHOO2ChmgpSfEsUG3gDDjeJ5Zo1U2aj25D\r\ngqPaMppinOP6gKy6EMHq1ksXRMFELSA119A9yHbwxjItowPWV9tzk4majCpG\r\nz54zbvg0l6cQd+LkFK16Kcgb0kpmirVsbW42naJES9BComQSwKYEfGuWwSMO\r\n2yZXOTK11kG6V3kPcSrnUBe07h9vza81Wh8eYnKIFv/eFQH3BepFUKYwcRMu\r\nOdpCMrnIEDLtcqbkqhLuMnQQ6Qwzib9rncqTUX3Inbf5VzR5I8hAR0svsL4Q\r\nXtF8UtY7TXW3mG0g4IMA9R81CdbQ3DVBABM=\r\n=n1Cy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.5","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.10_1676961688119_0.43119142463390303","host":"s3://npm-registry-packages"}},"9.6.11-beta-202303121944":{"name":"dynamsoft-javascript-barcode","version":"9.6.11-beta-202303121944","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.11-beta-202303121944","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"4fc70f1697291556ccad002b8c97df36091e859d","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.11-beta-202303121944.tgz","fileCount":70,"integrity":"sha512-i0o6SBTDERxbagDJk7nvtcRneEhFgyD5P46YhIX29U2qoWic26qZuvBZxFgy5Pz/nmhgmwMMcRw59xHR2ZgjdQ==","signatures":[{"sig":"MEUCIDTgNu3OsG23V8nZnVXc5hXsOM+lcyfACtX8zVM1wWxAAiEA7q1QCrsqFKE3b/JgTrHmLe6e4jqFbjhJ3nRq0LphVsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19071158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDo9yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXig//T0vp7j8QJKa8kgzKrcNweaQHL+cGtZrLUMz5WqzP6TFcSsC5\r\nOhfQAiooBd6hM/8NwBrRmPe9NS4kuIyVjmgtez7oFANCwkYxphR7bwAQuypK\r\nseG2ki8L3nhQBnUUHn3zTnQXyznc875ilcMqIutSoR6KjHv0gNODKWKOM7ak\r\n2yNMaG7ijDwXtL3TJmBGj7e549yWDmrlBFk076j6UpMORr7f4fGPBtv6U/gj\r\ntY/PA2IX+eCykaO0I9/HjHsYIs8BdoZrw8iBeer4heUYETmOc/9w4sLUxFmi\r\nWf2sLycyyKefyr0jK0FjjTRmxUcAsNBNHPRtmwlSmVPFJZK7KJ8d0PiV0o1G\r\ngh1IoLMly0LZ80xFcfGVJe7MUry1FU8fsN0pKmR1e+xkDuQOLwZwPxQfL5W6\r\nv7NRshUTVY7aGw+kO10lms+S5qrxrDoSzcFx/EMRJtRjvtKoLKB1cuaOoT/f\r\nxOOauKK9zBEBtGlCvYxdhf9IJ1lbdrkoEzqv0uiSSpJEnZuTnklWWogtt5WT\r\nyiat2r60Y6qnccByovLJKZBI4+zpzaWeY3TEM4WH6rhf9rTQGZu8OW/RUrSk\r\nWXFLByGiX4NMKQ4gTM5scCURFcwI1WMy5FGGOyk4F2KG5H5asRkuZ83QzewM\r\nPpLmsH5wC8GWaLGz8Zw5jaqs6a7IkIqraiM=\r\n=4UQE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.10&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.10&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.10&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.10&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.10&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.10&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.10&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.10&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.10/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.10/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.10&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.10&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.10/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.10&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.10/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.10&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.10/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.10&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.10&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.10).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.10&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.10&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.11-beta-202303121944_1678675826064_0.019916113451251327","host":"s3://npm-registry-packages"}},"9.6.11-beta-202303122340":{"name":"dynamsoft-javascript-barcode","version":"9.6.11-beta-202303122340","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.11-beta-202303122340","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"1b89df8ed84fd2500c8bf336673e46d81f42960a","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.11-beta-202303122340.tgz","fileCount":70,"integrity":"sha512-8+znoQIjP/bXj08oEwwXAYY2smnhaqRafJz911jT4JDK2Lm89UAnKhyMAx1635PzQF2oVOLM6nmXq0js8QZ+Dg==","signatures":[{"sig":"MEQCIC3cUxx7cVU6FY3CFNStwVBAKAXyqcxpcGLrWht9MB9KAiA9TWNpv7ALZMlU/TVg6oJq3Ol8AOVLaFg0a0CeoKzLXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19071158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDsa/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/4BAAjuA4AdJztipIuCTKQnWVaWDjRbAldxESd8FAtSnGlDDMm2wH\r\nkWEgYSWjGyAPcPBrH0uugUfH6sKhlnNgJwCaw4AXdwCv16CpuJ++JjTHMuSs\r\nxE56zOXR8MApAcFpw7yA/SRo7xEuKkh7fu9ogoTKruKUS1puMHgJTOdd7rDB\r\nLs8S2EzrML9cl/sTV3vk462Tr5wyVHyML1R5LuCMnptWER4ACis7n4Ma/it6\r\nnKs4t+1bb9cD1NDLpuvlwvNTaC/k1Xo1Fs/v4NmFioAMj81VRFlUun3jpqlM\r\nA2lsP+prgE4YAH6YDO8rllcf/dQqiKQxeAP6H78sStRz01EJ8ysrnpjXhM6u\r\nnbyprkv4ai39Tv6Iu9ARDmd/5rh79ZcKVHJxzERJmUDLamCG4/9MB4mpltdQ\r\nuPqArGzt2GwV2I/JqTsCk5YHrk/rAvVwwh+M4QLB/xcyMXl2l21MvdpYVBjQ\r\n+5WL2D+762JTNSmjNTNVPvm3DCQLghw1Us3tww24Hb7YXXb+oR5PFIcE5wMz\r\ni048i1dcx7oqjVRV40PN3lwS/GQqfdKumkrW88bbewCtk2SKtXNIaPjp3+n7\r\nO8k81ArY54tXntTN8X3oY30TKzTu8DdqxxhALBNHqbhzLuJOnsmeYtdnOmJc\r\nRUusv/me4BoxVf8Iap+xYzZj9WVd3bPEPfM=\r\n=1wTL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.11&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.11&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.11&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.11&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.11&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.11&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.11&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.11/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.11/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.11&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.11&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.11/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.11/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.11&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.11&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.11/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.11&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.11&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.11](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.11).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.11&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.11&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.11-beta-202303122340_1678689983169_0.8805352395528221","host":"s3://npm-registry-packages"}},"9.6.11":{"name":"dynamsoft-javascript-barcode","version":"9.6.11","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.11","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"4d0c28f5b56d631fc15d1181ace3652e42811d22","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.11.tgz","fileCount":70,"integrity":"sha512-oUvzDd5maX7JfyOPQElZWy8EfJGQ1pNEOmgjWp4zfxQ2R4mNqH6CpPKTU78v6giJSO4URKQJ5xGtNTFU/jObGg==","signatures":[{"sig":"MEYCIQCeF4Om9Nm+9KBWfRhLTbONnGxrRHxLzkuBBSUooCQNVgIhAKNgVe43Yt7y4uMQTdNNUX2N3SKHmjnHwmTDCmCwq2Z5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19071140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDtCOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr65g/+InbailJ6kctDWsf4HAsFHrNIuePEsEU0uD5hxuTpRFzPHyKG\r\njPfKONODOf9G8KoVoDc8flH/MRzNev/dKBezsEUBX9iRpJ+WDVuViFjbc0zI\r\nbPHLL+GRTDqYVNWgXbCBlJ9JnajpdEv8cdrwkNxD3dC+aXEVEjfr0hJ4J9S0\r\nrItep/SfeFI74D9QmRI4s2vGRhfJt2NcCsTKFcWxewTVX/rUyH9SQhxehBDK\r\nPeMXqcM+diGXKcYgIgfUrNWsGQhOlE+/MCI3atKsECEvHOP2rV7Ajc52m2to\r\n3pbQWZCaaaOKX+OG3S6DL6p4u1QkY0gxXydkHaZ8b6fMbXK5cU1e8KALILJl\r\n/oPcObyjCOJ9RuAxL2c2RUn6OfERvPas4B4RfNiRbRBTswOnilznUP+5s74o\r\nkE2+mHJYc6rhW18Mgh1+nYE5mGK7DpxL3KyPCxCR1BsuOClcFKZnY+E/82Hs\r\n4rPhZEB8bjCd+BJj8SSTvBu1WWzXFxJ6BdaiPzjYTZTqVYupka9vkDPhiG3f\r\nonzmVpQkmjUbDanzERJiS/mP0K7BNzuNguBbDK8Av/p31ARfS4xt3h3Tx49/\r\nuLfKYgrHKF1NPODShvFdOidur03xYBaogi/Bog/TexuDk1aD55881feqC250\r\nqA6YdyK0i/ZKmSj+6yaJn66NdzwLlXWu97g=\r\n=N+ZB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.11_1678692494112_0.05197425195513916","host":"s3://npm-registry-packages"}},"9.6.20-iv-202303280023":{"name":"dynamsoft-javascript-barcode","version":"9.6.20-iv-202303280023","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.20-iv-202303280023","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"0d3874729dd015c4d15adbe282f2b22f0c1f2188","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.20-iv-202303280023.tgz","fileCount":70,"integrity":"sha512-paAKMCNF5NR2bnupT9jzjfXKwgYTNJgD0bEyanrczNlt3/8DFyxhpT3GeTPi/i8Ju8D/U+63cJ+77F4nUB+L6Q==","signatures":[{"sig":"MEYCIQCNJ0V6GEqR04PE3n1K7RDJCTXJRWBqXDhIvAsljap0QwIhAPocBZ49irgBPY7zDxhexAucI+8f/iV44mE1xjY8T3KC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19067796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIpcSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOwRAAmz1+GS3vkorgMx6rZ8T4kJj9kCu2X4EoEPdELMCE+IDJBHqh\r\n260ynZ6jZ7SIMtBNLiHc5HD0QU+fMkWIEsFZpR5c+RioCY6g0h1/ge1X/R3v\r\nHkYM9kEntsUZwG0d6g2Zk/gbNatFl7F+QVtd8Qw3MRffmkL7/Fow6LF8wR/k\r\ncQxfNfXooH+4F61uoIDe/ARau6qpYwFSl0xe4deQDSqXe+r3gBI4fFXpO7wh\r\njtk+0hQx5Dy02tytl5vgcathRufUbQoZ8LJNy7121BVNOxxbgP2ZUGPY3yWY\r\nyZX9SWx8LMIJlwVzQImf1kfw9abr3Qq7YUUrGN4obJ60xEtSjanXQBQI1dqF\r\n5XyVEBEMNt5NCOnsbugnotmTpHndJIrnVyf1WFa3mN7duSzgZ6wM7/dXkNL5\r\nFp2OkUfwAGTBDPo6kIfXyil7K/ZLEZ6Zpi12qekZt+ECFSL6XaP8qhC/bZfA\r\nLfdJ3CDU/cMqroyBv6pIiTh9fYMgEi1PHwfy9ZUMxd7Z52t4135jA891ekfE\r\nromErePxgSXB+N7m2oZyihXTzoXX3qC5b7sp04RdEym97ESZJF04qmtQRd01\r\nghtNOlw6q97uW/NV5SzNu3NBO7uhg9n9adheNB71DElPw8WBn7ZEk42SOziE\r\nk+Hdrg/3MRWi8y6VFsRKuPSiR4R8j/CED0s=\r\n=A6Ls\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.11&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.11&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.11&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.11&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.11&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.11&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.11&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.11&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.11/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20-iv-202303280023/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.11&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.11/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.11&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.11&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20-iv-202303280023/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.20-iv-202303280023/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.11&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.11/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.11&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20-iv-202303280023/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.11&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.11&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.11](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.11).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.11&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.11&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.1"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.20-iv-202303280023_1679988497700_0.39716425539792555","host":"s3://npm-registry-packages"}},"9.6.20-beta-202304120143":{"name":"dynamsoft-javascript-barcode","version":"9.6.20-beta-202304120143","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.20-beta-202304120143","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"1b1ebbbdf0864e2378439f99535149d9e373f907","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.20-beta-202304120143.tgz","fileCount":70,"integrity":"sha512-9++Kkemg9H2xqzdYbAAw63ozR2e1Veobp4qlUZ1BIVPhpTAE5yh4ENWb8OOfPXEM1Yhd+ggBtp3FkKhVsVrf9A==","signatures":[{"sig":"MEQCIHeO3KnsDbBYTEgP4kdPyuLJiy6RIvYpN51ktd/QIUYIAiBRQ+52aHcEWSlg0EPt1pNXv2E0qafYZSbIw0FLG9sEjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17209874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNnCcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpA6BAAkhNphegfWz+TfqMX5uix9tx1M9CYJRyMK5ouVtH7q8tuKEma\r\noqa7PEp1klMAyqSx17JZWoJx+lznA1EvO/pXFiWbhQl7V7p9UbVi0nv6aKa8\r\nd6sWtgopm7SAY33ap0zlR0G/0n/+b03Fw+biLBIXrtbl6G5TNyieuciu11Fw\r\nAcUOPtVjpdE/jtE2U/R8r5Ta9Wm2jAlIzu3+A5WNU3/lr40OIPQXJl3Rn1Jv\r\nPoAWkIxIASYnTwj1P4fOKq/bkc8pJWxo1v4EibnBP5Dna7RuvZTgVspPOS9a\r\nUOBB+lMKr4TIDlYYQOzfTPEQor+lyD40/JGCpd8m3tLN6b0P8tP3GNIpqEOm\r\nSshuFuiziDKfpWvXrdZdBTnvpl960IgIf9nN9TG6J1di7W+NFCRUYxMpaJ/r\r\n7QI9dIzFcxC6yZHABMBi0uQAkRVSyZPI3q8sG2dGVLm9j2W11e5hiNRbOCta\r\n+iXZErGA2t05vLaaSGyLBWaSiPNt+l3P1ZHkdppFUfG/ttrxbKSEPiuurdes\r\nFcNmha9jS2IMd1LCSLUv7U4gho9j+yiLhPTUcBR5aObDtkj7AcRKBKH5AcTp\r\n3I5U4EQUzNlyJCnBeoo7RRv0F42olqciXlW1U9K571kc5/ko1KC+f//ptHOu\r\n/JsmFUiqH5KlKO35CMcXY2GXJZ22zJDNtuw=\r\n=jFFP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.20&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.20&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.20&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.20&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.20&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.20&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.20&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.20/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.20&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.20&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.20&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.20&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.20&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.20&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.3"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.20-beta-202304120143_1681289372521_0.8024437943156042","host":"s3://npm-registry-packages"}},"9.6.20-beta-202304171826":{"name":"dynamsoft-javascript-barcode","version":"9.6.20-beta-202304171826","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.20-beta-202304171826","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"770ece7299717f3581a67256ab7df8c5082856b9","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.20-beta-202304171826.tgz","fileCount":70,"integrity":"sha512-de9uHp/rE1v+r50ONdvvb7BfE2UXq+MYP+pONIVbA0yUNEBAhcwQLijrye2ogEl8Y0ykM/cb0sAeFVoKcstPfA==","signatures":[{"sig":"MEQCIFUx37Ulgc1U0NIV1haNgrsD2oOacUbsqdppHUV0+NIiAiBZb+8Vt2qG1Wvu9DgYtRjUaOuBzC0xhABJuPPXrcKUAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17209104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPfM3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqexQ/7Bo6TVQpp2fAYJ7KpemeGcu/6F91tKZaREFLvpODeHnaJDyWW\r\ntF7QEnLONKNkW8n5v0PGnAlw/3m0RRGScTOTOOaZnoe5p0qx5lDVT7wZFtcd\r\nx7kNYzJyo43fkkr1RkgBRsjq5fPaGgsxxVN+1t/gRoSN1V46pL4ewT0Bzpx0\r\nm25yniPaS6nUIvhHLV51pTo3gBi8jzUyQPhtZOdYxChquYj7ls20PzxLGPJK\r\n88jDcVCjDfZvJP3S5TNr0Sm46G31HAmQJJMjAAfz7zHEIXF7COZfZnprR9Ts\r\n31frwsHyOeD2ogTrJrEdn34gcIDwOYvQIU6jI/ccEI/7VZw691dbGWZ21Anb\r\nhyvh20UEXZkAQywKBXL26QO7n21HsjzkkHuDxHMGujz/sQLYMu5eWeqKIROt\r\nJa2uqJ7u2Qozdbb6STpUD3aPVOSJg9OuMnRJ4K33VWHGJrqjAk/Bp5AujB1I\r\njhmlDTVT2wcacxZU8DK6LRyAF1x6zOmqn2y9BxZtWcY/d2diUw116Oecugu9\r\ni47vrkU7PuUVOjULTHKyuQmsJw87KenAE/cu1zj9OiDhZWC+5BTasnn54Vt8\r\n5n4zoujcXEZ4vF81uS7NaVsJuerDHUJL3SPSGAbHZrG9xgxTmxxAtTssE7X0\r\nEjQmeVdzvr7f2tlkuSD5qb35pTFvv/VdBj0=\r\n=VOiG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.20&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.20&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.20&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.20&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.20&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.20&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.20&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.20/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.20&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.20&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.20&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.20&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.20&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.20&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.3"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.20-beta-202304171826_1681781559520_0.14306323168481505","host":"s3://npm-registry-packages"}},"9.6.20-beta-202304172243":{"name":"dynamsoft-javascript-barcode","version":"9.6.20-beta-202304172243","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.20-beta-202304172243","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"c4825e90776aa79bad5647e99b853cb880551e13","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.20-beta-202304172243.tgz","fileCount":70,"integrity":"sha512-UF20+qHePGo4uI8JvMn3tTTG344uWjI3bfJf5s93W7o2Y/Xi1FCwk/zQMwyhj9AVULxyBLvvNGpuKbEw+T+P9g==","signatures":[{"sig":"MEQCIH/m2v+wvF2ap9bSnNcMaRsuMJXlUyfLjw3aLtrsrXelAiA3Y4Dp6X4LfZ/kpAhqE6e+2H2LToRVae2hmljnqRMRew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19074224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPi9KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQRw//aiejCuejFaFINq0ZVvmQDNzI1p5jqZkYeBkz2ayUQ1y4bDS2\r\nCLCVUE9pL6Q5ZD5KdkJYqFL9aGNLTq5h6uGFAmanbsB9CXx/gYlvLFodz+sK\r\npxoqyiA7iIH8zZVKZx9BBMoHncJ4LwqBncq7JsUNuli2iQIfkgP0l+GKI+wD\r\nkgT9OXJsNVgr6iZ01fSniLi8CS/FR7nrAn/X+bz/KPge7qDHAAt5oEsKCDvF\r\njmxA8pdjcVOU5POtqwWqlSw5kx0mg5a0oIPYyuVi7q7pdKuQzEKzp+0jAe4u\r\nZuLpCMS/aHXaa8IZJ4BFF6oGSCdU/3iKLL6XZk1SIZwao1VL3fHzKphY4ngj\r\nPdacpeeYWPm6ZTDls7MpfYPq92/Dey+cxfS4u9A3hVOqrsymO1bYNxQAK8iz\r\n71jwIWP/WjIl0nMHiaVqtKeForgerT78dGaWEODzcdadR47Tro+l9uMVRkQy\r\nJPamXH1OlLtaPixLnry4sjcUNwvYYWffbowWpDPnKWa5T44MW7Wr5Twlgpiy\r\nI7kBiwUVVDgRlXYWX7PBWZveT8MWODUnm3eTDYQ0bFQ5aSzbQ+2kUE2mBzni\r\nCAIISHZ4NTLd+2wLrqfJnkfjM89VmlBERSrSs7xHKvxnf5Bop80eZEsPI/SP\r\nbG+7fh7UL3E0xMpc6Q1LG6k8bvUlac/CYs8=\r\n=XZQb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"true\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.20&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.20&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.20&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.20&utm_source=npm)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.20&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.20&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.20&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.20&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.20/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.20/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.20&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.20&utm_source=npm).\r\n\r\n**Pinned Message:**\r\n\r\n- [Temporary solution for iPhone 14 Pro Max rear camera not focusing](https://github.com/Dynamsoft/barcode-reader-javascript-samples/issues/99#issuecomment-1407584605)\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.20&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.20/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.20&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.20&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.20&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the cloest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.20).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.20&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.20&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.4"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.20-beta-202304172243_1681796938586_0.8677295065621669","host":"s3://npm-registry-packages"}},"9.6.20":{"name":"dynamsoft-javascript-barcode","version":"9.6.20","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.20","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"42c8f266f1fc5cdd36f314d43dc3a8a5c78ea35f","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.20.tgz","fileCount":70,"integrity":"sha512-sq3mRiqGo3H5hPSA/5of8NRcRwwQnNaNRyD6xRltXwJmQbavMm+GX0hQsOVoXYNmuxLv6i/n+lfQn29R3g67uw==","signatures":[{"sig":"MEYCIQC0ZYZa3L5OMtp3KiMSCt5c1nxmbEB4HbHXsB2frR4mOwIhANFVD5HLGNxFpw9ttwnzD3fbzu1f8J2x2jCeaFlJQR/0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19074206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPj/9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqR7A//XaHKFlVYGQ9HWiARqwNjP2ct+pUN9bG4GzufBY9xHw2uzID6\r\nsJ3DLuFr7HzIdYFgOBh5XRmzVAYhYSumj/bSxwSKLUwuAy320BJ7fFgpnBu/\r\nCdnJDif3Qk8eUo9YgSIogUCg7Kq7u6OemdJ7wzLakehJOQnkVv6o4t50CzlU\r\nRx5hIVwWChKUjx97kJxps4L0yTKTPAnBhP5PQ3qg7BHUHLUiTmqM8asbChlF\r\nVzzvv502mUYdfpQNOXF5GbMKy1sVRtsmsPNnTzSZ7LHgFW79aw0k2PIRYa9K\r\nbmznBDFAqhXS3uA47Vw62DFcJvdTa2HbdNYwBorDypkMgNAWt9eBLcYnXBKW\r\nqtPv77WkKSKRTpcpau7tnyLKwJjnzWcX+JfmUavJzO5LCcRMAU4eWoy2IPEg\r\nVA93ja0IPZx5aUl9FXRzYfVW5OsNzq73okBjfm9FRcyzu1yv7NkzLAh0CJtY\r\nNViZfrC1ejWTlAu4AvIp0X4XI47VOoga+KZ7x/yKDuROyrGPSpGy4B6rhCBX\r\nQ5b6yO+GXCGYJVTjqjjtt/PKehoVE/rsz4nEjVcaBstfPUe/w71ADHbp/URK\r\n/1+mnKUu+TXXYTymlSDRsqPjlNpi9KgTld/LBtcGXhukpiMGjEc7xJQqJ2+R\r\n+iPsX83ETk21cdKCrwdDyUC7xXfRlT3Mp6g=\r\n=Umra\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":"./dist/dbr.pure.esm.js","require":"./dist/dbr.pure.js"},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.4"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.7","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.20_1681801213251_0.3066764783657818","host":"s3://npm-registry-packages"}},"9.6.21-beta-202308022353":{"name":"dynamsoft-javascript-barcode","version":"9.6.21-beta-202308022353","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.21-beta-202308022353","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"1519eae1d1fe235dbe6d44fc9b47e928da0f88b3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.21-beta-202308022353.tgz","fileCount":70,"integrity":"sha512-de5ClHhrZI5GFMRgfgJHRVXLxghpu1WLBH4XBuHBmypW2kiyObsY+xQ38hdfJSJ0G0i/SYe3H02qGcZPaINciA==","signatures":[{"sig":"MEUCIG58P9z9ywbRRyrTgRFxoI//jb3NYzzqh42AmeeniOoGAiEAk35Q3r2bXq6vhqhZPtYQdAFan3Po4UhXFPt6YkucoOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19104345},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.21&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.21&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.21&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.21&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.21&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.21/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.21&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.21&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.21&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.21&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.21&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.21/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.21/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.21&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.21/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.21&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.21/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.21/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.21&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.21&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.21/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.21/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.21&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.21/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.21&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.21/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.21&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.21&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.21](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.21).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.21&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.21&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.5"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.21-beta-202308022353_1691054167684_0.3259836071363924","host":"s3://npm-registry-packages"}},"9.6.21":{"name":"dynamsoft-javascript-barcode","version":"9.6.21","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.21","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"d46876c11f9f35db6a72056368bb944ff2624626","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.21.tgz","fileCount":70,"integrity":"sha512-b4GsfsTTTVLyqeUtek7wimgMcdi9OjLC8N2K30Z6JwFwGMMvvBfvGmvkOKvMWY/yzxOISX+4coUp/0TUEyadXw==","signatures":[{"sig":"MEUCIEuBhhWbP79XELj4KA7LIT1TxClZ7L4juRIavIDDHI+2AiEA4LMGPNkOaxrFhh+2FqSl+qpi/szCRmWRAshlKHdVpPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19104327},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.4.1","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"10.15.0","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.5"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.21_1691055543353_0.9793424294647735","host":"s3://npm-registry-packages"}},"9.6.30-beta-202309130021":{"name":"dynamsoft-javascript-barcode","version":"9.6.30-beta-202309130021","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.30-beta-202309130021","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f5839d697292ed453f3dc1e890ca3b7932fdb029","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.30-beta-202309130021.tgz","fileCount":70,"integrity":"sha512-rwmxLhou8dp3BMZ+K897D+02S7chH5yU7/1Lh8uIucpLJVL3Lkx3DOeQbqiy3LE4kMkg5nKQwQvdsIGLU8wgHw==","signatures":[{"sig":"MEYCIQDYVYHmUXvb/43MO02XzB0Jh9sPJvm7M1/G/xaREDKENwIhAIcdxKHdSrorXvIYfNLyiuSUCcPAPcVaQhJbeMVIihUY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19120097},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.30&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.30&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.30&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.30&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.30&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.30&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.30&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.30&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.30&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.30&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.30&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.30&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.30&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.30&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.6"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.30-beta-202309130021_1694590020938_0.7788887945572016","host":"s3://npm-registry-packages"}},"9.6.30":{"name":"dynamsoft-javascript-barcode","version":"9.6.30","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.30","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"176f9be18300802ca244f0dc026cbd3ea06de29d","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.30.tgz","fileCount":70,"integrity":"sha512-JjgOmCnfaCpR2+PrT+BcM0thOveK3OrWJih6b8tqPIY0Bi4h+NvbKsluTUErxABib7tazBkt1NFuNcV07jFPgA==","signatures":[{"sig":"MEUCIQDBXFcdf5mJbwzPGIIe4eL1Io3IJ4sxViz4i4i0zROhkAIgJYR+OJGpvAvk2M99iR2YhTy7t6qcGTecci650RVYOgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19120079},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.6"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.30_1694591517621_0.03108965088694471","host":"s3://npm-registry-packages"}},"9.6.30-iv-202309261832":{"name":"dynamsoft-javascript-barcode","version":"9.6.30-iv-202309261832","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.30-iv-202309261832","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"e5d80eb313f1c545a4184842ce1998833599938c","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.30-iv-202309261832.tgz","fileCount":70,"integrity":"sha512-FSnRrnS6E48pLNg4Tvx7pEHe9kWP7MlSYMFu2JoY9ytpTqIpfEsICmDRZ5i0VA7ibNlPSc4Rri5fmT8dRFKMmA==","signatures":[{"sig":"MEUCICIFdvfQJia6TyLfkS8dsb/E7swETV4l1HzEfJvK/9pQAiEAgjRxliiCezACKgWTzzyYktS6mcs0FG2snZkBFmBza3c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19140647},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.30&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.30&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.30&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.30&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.30&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.30&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.30&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.30&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30-iv-202309261832/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.30&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30-iv-202309261832/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.30-iv-202309261832/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.30&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30-iv-202309261832/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.30&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.30&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.30&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.30&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"test":"node ./samples/node/helloworld.js","build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:readme":"node ./updateReadme.js"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.6"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.30-iv-202309261832_1695778705999_0.9358857850423132","host":"s3://npm-registry-packages"}},"9.6.30-iv-202310102228":{"name":"dynamsoft-javascript-barcode","version":"9.6.30-iv-202310102228","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.30-iv-202310102228","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"432df78abaefc2863f740ae6cf1ae8787528e9f1","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.30-iv-202310102228.tgz","fileCount":70,"integrity":"sha512-4ewCgzgPyOCVU+Fkxyso/0w/tHFgN7MNUyVJ1QTOVuTPoyF8qAgYIW4CZ7uLsiCPI5jVN5L0QJvEzy4Zjq6bCQ==","signatures":[{"sig":"MEYCIQCvg2/qHOYwjgO5oJoWU0gMpyH26WH8NqzVIgrsUNVKYwIhAKWnZ+FeA8pjCFtUXQIAtoS202g9Ch/3cUONmcOeBrSy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19141977},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.30&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.30&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.30&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.30&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.30&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.30&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.30&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.30&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.30&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.30/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.30/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.30&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.30&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.30/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.30&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.30/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.30&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.30/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.30&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.30&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.30).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.30&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.30&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.7"},"publishConfig":{"tag":"iv","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.32","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.30-iv-202310102228_1697002484435_0.8194170869840149","host":"s3://npm-registry-packages"}},"9.6.31-beta-202310112234":{"name":"dynamsoft-javascript-barcode","version":"9.6.31-beta-202310112234","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.31-beta-202310112234","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"d6719c8d0b00534577d4932d8f8174268f103c4f","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.31-beta-202310112234.tgz","fileCount":70,"integrity":"sha512-abT7OmLSLzFVQm9eGamP0YAuuoCuo6ix/gew4GXSfk1MWLK+BAV8p8Sj4upgDsXQ6rhIfswtSvbLjBe95ocXdw==","signatures":[{"sig":"MEUCID7aEFU4x31jFC1nBiblp7qw6S0oMBmSlIwtt/OLbuAnAiEA3s+BQJQs5+Ci77ismG/6px6+XBlVrhkrZGEk3sLk9u8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19142715},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.31&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.31&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.31&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.31&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.31&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.31&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.31&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.31&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.31&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.31&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.31&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.31&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.31&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.31&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=v9.6.21 --path=programming/javascript/user-guide/index.md"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.8"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.32","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.31-beta-202310112234_1697089295201_0.9177006674290635","host":"s3://npm-registry-packages"}},"9.6.31":{"name":"dynamsoft-javascript-barcode","version":"9.6.31","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.31","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"2d23e7e7c846671748b6fcaf434c45759b1aa7be","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.31.tgz","fileCount":70,"integrity":"sha512-32v13EefTWeRdpUr6dbcoMPC2TttCRSdKb2JCrprIQzp6jCp2UNBpxRynoSUU9cgLVZnvk+ZJAur+djLfdyH9Q==","signatures":[{"sig":"MEUCIQCRRU9B9uEPDQJBNBWBRo7qDt1vSfZFBMDhU7aVkLzDbwIgQl3uyMcrvKwLb/OyRg27BZllIMhCA31EOVOPHb/O6d8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19142699},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=v9.6.21 --path=programming/javascript/user-guide/index.md"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.8"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.32","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.31_1697090693853_0.35181071394820407","host":"s3://npm-registry-packages"}},"9.6.31-beta-202310191909":{"name":"dynamsoft-javascript-barcode","version":"9.6.31-beta-202310191909","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.31-beta-202310191909","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"745c5b756128924d38afdc127d99218785ce7214","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.31-beta-202310191909.tgz","fileCount":70,"integrity":"sha512-6v4iOlxpMcZSP0wYZ+wrYA8fQRyY46jPB/6bRxN70r0Iynqz/tzmJHIJn53Id8dTmq5VuOePu56U2ZAXSqr1kA==","signatures":[{"sig":"MEQCIBqCYnYGm52rDVRdSlkYPhpHWif5wYnzpFLJGnoSqrEIAiAIwFYimrwBBZuSMMTfFiCztPEGG8IvgrBhObUvqeeRhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19142053},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\n\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\n\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\n\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\n\n<video controls width=\"400\" autoplay=\"false\">\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\n</video>\n\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\n\n<span style=\"font-size:20px\">Table of Contents</span>\n\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\n  - [Understand the code](#understand-the-code)\n  - [Run the example](#run-the-example)\n- [Building your own page](#building-your-own-page)\n  - [Include the SDK](#include-the-sdk)\n  - [Configure the SDK](#configure-the-sdk)\n  - [Interact with the SDK](#interact-with-the-sdk)\n  - [Customize the UI (optional)](#customize-the-ui-optional)\n- [API Documentation](#api-documentation)\n- [System Requirements](#system-requirements)\n- [How to Upgrade](#how-to-upgrade)\n- [Release Notes](#release-notes)\n- [Next Steps](#next-steps)\n\n**Popular Examples**\n\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm)\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.31&utm_source=npm)\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.31&utm_source=npm)\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.31&utm_source=npm)\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.31&utm_source=npm)\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/1.hello-world/14.read-video-webview)\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.31&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.31&utm_source=npm)\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.31&utm_source=npm)\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.31&utm_source=npm)\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/5.others/debug)\n\nYou can also:\n\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/)\n\n## Hello World - Simplest Implementation\n\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \n\n- Basic Requirements\n  - Internet connection\n  - [A supported browser](#system-requirements)\n  - Camera access\n\n### Understand the code\n\nThe complete code of the \"Hello World\" example is shown below\n\n```html\n<!DOCTYPE html>\n<html>\n\n<body>\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\n    <script>\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\n        // Initializes and uses the SDK\n        (async () => {\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\n            scanner.onFrameRead = results => {\n                if (results.length > 0) console.log(results);\n            };\n            scanner.onUniqueRead = (txt, result) => {\n                alert(txt);\n            };\n            await scanner.show();\n        })();\n    </script>\n</body>\n\n</html>\n```\n\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\n  </a>\n  &nbsp;\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\n  </a>\n  &nbsp;\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\n  </a>\n</p>\n\n-----\n\n#### About the code\n\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\n\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\n\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\n\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\n\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\n\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\n\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\n\n### Run the example\n\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\n\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\n\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\n\n*Note*:\n\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\n\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\n\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\n\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.31&utm_source=npm).\n\n## Building your own page\n\n### Include the SDK\n\n#### Use a public CDN\n\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\n\n- jsDelivr\n\n  ```html\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\n  ```\n\n- UNPKG  \n\n  ```html\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\n  ```\n\n#### Host the SDK yourself\n\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\n\nOptions to download the SDK:\n\n- From the website\n\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.31&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\n\n- yarn\n\n  ```cmd\n  yarn add dynamsoft-javascript-barcode\n  ```\n\n- npm\n\n  ```cmd\n  npm install dynamsoft-javascript-barcode --save\n  ```\n\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\n\n```html\n<script src=\"/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js\"></script>\n```\n\nor\n\n```html\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\n```\n\nor\n\n```ts\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\n```\n\n**NOTE**\n\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\n\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\n\n  ```cmd\n  Cache-Control: max-age=31536000\n  ```\n\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\n\n### Configure the SDK\n\nBefore using the SDK, you need to configure a few things.\n\n#### Specify the license\n\nThe SDK requires a license to work, use the API `license` to specify a license key.\n\n```javascript\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\n```\n\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js).\n\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\n\n#### Specify the location of the \"engine\" files\n\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\n\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\n\n```javascript\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/\";\n```\n\n### Interact with the SDK\n\n#### Create a `BarcodeScanner` object\n\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\n\nTo use the SDK, we first create a `BarcodeScanner` object.\n\n```javascript\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\nlet scanner = null;\ntry {\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\n} catch (ex) {\n    console.error(ex);\n}\n```\n\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\n\n```javascript\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\nlet pScanner = null;\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\n    try {\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\n    } catch (ex) {\n        console.error(ex);\n    }\n});\n```\n\n#### Customize the `BarcodeScanner` Settings (optional)\n\nLet's take a look at the following code snippets:\n\n```javascript\n// Sets which camera and what resolution to use\nlet allCameras = await scanner.getAllCameras();\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\nawait scanner.setResolution(1280, 720);\n```\n\n```javascript\n// Sets up the scanner behavior\nlet scanSettings = await scanner.getScanSettings();\n// Disregards duplicated results found in a specified time period (in milliseconds).\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\n// (setting this value larger is a simple way to save battery power and reduce device heating).\nscanSettings.intervalTime = 100; // The default is 0.\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\nawait scanner.updateScanSettings(scanSettings);\n```\n\n```javascript\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\nawait scanner.updateRuntimeSettings(\"speed\");\n\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\nlet runtimeSettings = await scanner.getRuntimeSettings();\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\nawait scanner.updateRuntimeSettings(runtimeSettings);\n```\n\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\n\nAs you can see from the above code snippets, there are three types of configurations:\n\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\n\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\n\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\n\n  ```javascript\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\n  let settings = await barcodeScanner.getRuntimeSettings();\n  settings.localizationModes = [\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\n  ];\n  await barcodeScanner.updateRuntimeSettings(settings);\n  ```\n\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\n\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.31&utm_source=npm).\n\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.31&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\n\n### Customize the UI (optional)\n\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\n\n#### Modify the file `dist/dbr.ui.html` directly\n\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\n\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\n\n  ```javascript\n  // This line only takes effect before the method `createInstance()` is called.\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\n  ```\n\n#### Append the default UI element to your page, customize it before showing it\n\n  ```html\n  <div id=\"div-ui-container\"></div>\n  ```\n\n  ```javascript\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\n  ```\n\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\n\n1. **Embed the video**\n  \n  ```html\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\n  </div>\n  <script>\n      (async () => {\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\n          scanner.onFrameRead = results => {\n              console.log(results);\n          };\n          scanner.onUniqueRead = (txt, result) => {\n              alert(txt);\n          };\n          await scanner.show();\n      })();\n  </script>\n  ```\n\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\n\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\n\n2. **[Optional] Add the camera list and resolution list**\n\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\n\n  ```html\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\n        <select class=\"dce-sel-camera\"></select><br>\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\n    </div>\n  ```\n\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\n\n  ```html\n  <div id=\"div-ui-container\">\n      <select class=\"dce-sel-camera\"></select>\n      <select class=\"dce-sel-resolution\"></select>\n      <br>\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\n  </div>\n  ```\n\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\n\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\n\n  ```html\n  <select class=\"dce-sel-resolution\">\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\n  </select>\n  ```\n\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\n\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\n\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\n\n## API Documentation\n\nYou can check out the detailed documentation about the APIs of the SDK at\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31).\n\n## System Requirements\n\nDBR requires the following features to work:\n\n- Secure context (HTTPS deployment)\n\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\n  \n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\n  \n  - Dynamsoft License requires a secure context to work.\n\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\n\n  The above four features are required for the SDK to work.\n\n- `MediaDevices`/`getUserMedia`\n\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.31&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\n\n- `getSettings`\n\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\n\nThe following table is a list of supported browsers based on the above requirements:\n\n  Browser Name | Version\n  :-: | :-:\n  Chrome | v59+<sup>1</sup>\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\n  Edge<sup>2</sup> | v16+\n  Safari<sup>3</sup> | v11+\n\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\n\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\n  \n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\n\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\n\n## How to Upgrade\n\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.31&utm_source=npm).\n\n## Release Notes\n\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\n\n## Next Steps\n\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\n\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=_dev --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=v9.6.21 --path=programming/javascript/user-guide/index.md","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=true","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=false","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.8"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.80","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.31-beta-202310191909_1697768226208_0.8736117123761584","host":"s3://npm-registry-packages"}},"9.6.31-iv-202311010046":{"name":"dynamsoft-javascript-barcode","version":"9.6.31-iv-202311010046","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.31-iv-202311010046","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"9c313f29bc27dfdcaa129b536bd407a9c92a6bd1","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.31-iv-202311010046.tgz","fileCount":70,"integrity":"sha512-5nmOx1beEZ94hISIP/Gt0EO7+mpW+lAADxJNn4QuY0ZcH0WeZpqh6Dj8XFItfJro5CLuv+WzOq2/9YQS4yZGeQ==","signatures":[{"sig":"MEUCICbQpyQRlc01mY0IGR3NMc8Qei7ldE/nYDygj5fmhutIAiEAnjqTQBT08ogBSFR4ryNp4PKUq//Nt5hDBPgQ0qjWddo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19149553},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.31&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.31&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.31&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.31&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.31&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.31&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.31&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.31&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.31&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.31/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.31/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.31&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/company/contact/?ver=9.6.31&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.31/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.31&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.31/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.31&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.31/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.31&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.31&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.31).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.31&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.31&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=_dev --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=v9.6.21 --path=programming/javascript/user-guide/index.md","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=true","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=false","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.8"},"publishConfig":{"tag":"iv","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.80","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.31-iv-202311010046_1698826576768_0.3928196680808913","host":"s3://npm-registry-packages"}},"9.6.32-beta-202312061835":{"name":"dynamsoft-javascript-barcode","version":"9.6.32-beta-202312061835","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.32-beta-202312061835","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"cad3d1dab972b8e0f6a2097bedbda7cc3f5a7adb","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.32-beta-202312061835.tgz","fileCount":70,"integrity":"sha512-N+jvphqp5VjAEzFpAN+mdfbn+ZWL+gMKjG8hTIuDgHk6z7tgWUcvXXaZ0bzB4NtdV2u/wr7wkv5rHP9RPa1LIg==","signatures":[{"sig":"MEYCIQC9jjFgGB5vWaQ1Ez1TzrT+lyOdQ6DyFftUo/orCvusowIhAJzZ41kKI+vCDmrRwqS81hUYwE21xW0AezcUvDMaQvBg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19152221},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\nIn this guide, you will learn step by step how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.32&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.32&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.32&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.32&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.32&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.32/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.32&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.32&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.32&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.32&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.32&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.32/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.32/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.32&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.32/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.32&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases (such as some restricted areas), you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.32/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.32/dist/dbr.js) for the test. However, please DO NOT use `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.32&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.32&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.32/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.32/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.32&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.32/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```ts\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.32&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.32/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.32&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.32&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">ask 1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">ask 1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.32](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.32).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.32&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.32&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=9.6.32 --path=programming/javascript/user-guide/index.md","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=true","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=false","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.9"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.80","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.32-beta-202312061835_1701916939214_0.12267101502961042","host":"s3://npm-registry-packages"}},"9.6.32":{"name":"dynamsoft-javascript-barcode","version":"9.6.32","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.32","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"2655f7c134d315adfed4f5c94ada0a4c9827e0fd","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.32.tgz","fileCount":70,"integrity":"sha512-zCk2T9td8X5mdx42YiTKF6gxfjFKH3J8apMkcCYdAAqOAvy723Amv9rkgvI+Nt81/+9FcZWjT34ouzBYjQQeVA==","signatures":[{"sig":"MEUCIBauDcOlN88x7enCUN3/1tF/bXOUuS8eLmN+RKmzbHUPAiEAwljjMGPqbshPdYmA7h34F7qb1M6NlUYVC8V7tHzqvNs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19152205},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=9.6.32 --path=programming/javascript/user-guide/index.md","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=true","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev=false","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.9"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.3.1","rollup":"2.58.0","typedoc":"0.22.6","fs-extra":"8.1.0","showdown":"^1.9.0","typescript":"4.3.5","@types/node":"16.11.2","highlight.js":"^9.15.6","mutable-promise":"^1.1.13","@types/node-fetch":"2.6.1","@scannerproxy/dlsjs":"^2.0.9","rollup-plugin-terser":"7.0.2","@dynamsoft/rd2-scripts":"^0.0.80","@rollup/plugin-replace":"3.0.0","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"1.3.0","@rollup/plugin-typescript":"8.3.0","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"13.0.5","@scannerproxy/curscript-path":"^1.0.3","typedoc-plugin-missing-exports":"0.22.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.32_1701927392672_0.15176699110561231","host":"s3://npm-registry-packages"}},"9.6.33-beta-202402032314":{"name":"dynamsoft-javascript-barcode","version":"9.6.33-beta-202402032314","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.33-beta-202402032314","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"19ef70dfd2de96aec585ca95cc8b0da650306d56","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.33-beta-202402032314.tgz","fileCount":69,"integrity":"sha512-AEViU8KZzhh/7zUEzhNkRJWLQJCnLPTd8N1M83i+DujYv/glEkfd22yK7yGoDlDGV8SDlESR707um12QNnoV8g==","signatures":[{"sig":"MEYCIQChOE/BhMp/EH9EP2YKIzzv6ledh8CtigByONahjWybmQIhANhzyUFu4Yukz/bLoOJoju9oAtslQcxpMYko9l2aDrVy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19146542},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.33&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.33&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.33&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.33&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.33&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.33/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.33&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.33&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.33&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.33&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.33&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.33/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.33/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.33&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.33/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.33&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.33/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.33/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.33&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.33&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.33/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.33/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.33&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.33/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.33&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.33/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.33&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.33&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.33](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.33).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.33&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.33&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.10"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.33-beta-202402032314_1707032328981_0.15563870091048315","host":"s3://npm-registry-packages"}},"9.6.33":{"name":"dynamsoft-javascript-barcode","version":"9.6.33","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.33","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"7e0672f05f51d8ab2abc35b55dea2244c6aa66d5","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.33.tgz","fileCount":69,"integrity":"sha512-IMNfgDAuG5B5lVcVD1fs0tgWACVHERHqZVuXcKdzoCWBunLdHpHNhkJ+EDr7puKaGnFrD5CPYIPYy4cqm4Q2lg==","signatures":[{"sig":"MEUCID9frsJwZjiWUnhXbO6AeiYg6HNAbAn1Clux104sXex1AiEAzC1boX/cSqQuZN2bdajo1cJx4jeKGWd8aMxgYoYmpFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19146526},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.10"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.33_1707033141235_0.2557364351130931","host":"s3://npm-registry-packages"}},"9.6.40-beta-202403141926":{"name":"dynamsoft-javascript-barcode","version":"9.6.40-beta-202403141926","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40-beta-202403141926","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"f902569fd8c786f6341896dc683b43ffb91ebbe3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40-beta-202403141926.tgz","fileCount":69,"integrity":"sha512-fyArDLfDCGLVap1yOcWuhJrXz687Y2Pqdpa3+/Xk1q3i6iENVfDluFU5iRCZ5+TukcEoWVyg8Z/+2va+nhahLg==","signatures":[{"sig":"MEUCIDV97Jd+OYjUNY22E0UUD8sHm0fKFbTwnRXIGDxzaz/BAiEA1Wn8L8HKUurMIeOZ0uZW9FX5U9knhfgLhUsKZtQgT3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19122819},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/3.read-video-angular) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/3.read-video-angular/dist/hello-world/?ver=9.6.40&utm_source=npm)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/4.read-video-react) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/4.read-video-react/build/?ver=9.6.40&utm_source=npm)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/6.read-video-vue3) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/6.read-video-vue3/dist/?ver=9.6.40&utm_source=npm)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/10.read-video-pwa) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/10.read-video-pwa/helloworld-pwa.html?ver=9.6.40&utm_source=npm)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.40&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/2.read-a-drivers-license.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/2.read-a-drivers-license.html?ver=9.6.40&utm_source=npm)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/1.fill-a-form-with-barcode-reading.html) \\| [Run](https://demo.dynamsoft.com/samples/dbr/js/4.use-case/1.fill-a-form-with-barcode-reading.html?ver=9.6.40&utm_source=npm)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html) \\| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/4.use-case/3.show-result-texts-on-the-video.html?ver=9.6.40&utm_source=npm)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.40&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.40&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.40&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.40&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.40&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.40&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.10"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40-beta-202403141926_1710470568819_0.9305223087521326","host":"s3://npm-registry-packages"}},"9.6.40-beta-202403142006":{"name":"dynamsoft-javascript-barcode","version":"9.6.40-beta-202403142006","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40-beta-202403142006","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"11010cbf8d9caf123c08c023c1099c5218b1147e","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40-beta-202403142006.tgz","fileCount":69,"integrity":"sha512-aYHhRAVoHKsvUSY+UIKTRVZxtrBR2ClGVW2AburiOXPJrhB3IEDT7bOfyQTiesYI6uuoNe6pNkZxj9YsPzh4Kg==","signatures":[{"sig":"MEUCIQCs/9NRhnJoLkEd3Dn9clK5horCCnlbCA/hx/b69WCS6AIgOW8PjzBhIEWhPpmJZiRLhYTpO7XEpgl7eFTvnptFxrI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19120610},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.40&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.40&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.40&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.40&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.40&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.40&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.40&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.10"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40-beta-202403142006_1710472892529_0.6018655603360283","host":"s3://npm-registry-packages"}},"9.6.40":{"name":"dynamsoft-javascript-barcode","version":"9.6.40","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"5fb680abc99071c9f390e0dd0f47d6ea3d623bb5","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40.tgz","fileCount":69,"integrity":"sha512-KZGaIqLqxEUwpcsAMS0102QAScJQ4k7RvoLUW0proli31OFzpN6ACi9t7QXAnQcqTHyW63fyNUCX9FQphQ0p9A==","signatures":[{"sig":"MEUCIQDGOkM7UTB9KsfhgHu6C2f+Y8MdLubuNhlK+NZlZXlqLQIgEkJW4QMjqVL+ISKP2Ky7QV1dmPlit4wBLxDC1VXQAkw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19120795},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"^3.3.10"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40_1710727737400_0.5994259315601793","host":"s3://npm-registry-packages"}},"9.6.40-iv-202404120107":{"name":"dynamsoft-javascript-barcode","version":"9.6.40-iv-202404120107","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40-iv-202404120107","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"1fac081a8e065e872bb3dc17189d07c68b6d86e3","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40-iv-202404120107.tgz","fileCount":69,"integrity":"sha512-l2mEbmtsx7lHT4NoxpN+I+PstgIu86wkFNc7zZaaMF6VXUDmREs7M1doFthNKtGxTR3xFysEA8sjBFtRqql1Uw==","signatures":[{"sig":"MEUCICdFyGVwLsjP2gaCOlmvp20l5w/N++46oclkklGGIxSrAiEAvgyDYIxOLNtqWeZZ0ATOY8Cr+K8kdYKBBVdV3ntS3xE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18200116},"main":"./dist/dbr.pure.js","types":"./dist/types/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.40&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.40&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.40&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.40&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.40&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.40&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.40&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/types/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-iv-202404110311"},"publishConfig":{"tag":"iv","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^2.58.0","fs-extra":"^8.1.0","typescript":"^4.9.5","@types/node":"^20.11.10","mutable-promise":"^1.1.13","@types/node-fetch":"^2.6.1","@scannerproxy/dlsjs":"^2.0.9","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^2.0.0","@types/node-localstorage":"^1.3.0","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^1.0.7","@rollup/plugin-node-resolve":"^13.3.0","@scannerproxy/curscript-path":"^1.0.3"},"peerDependencies":{"node-fetch":"^2.6.5","node-localstorage":"^2.2.1"},"peerDependenciesMeta":{"node-fetch":{"optional":true},"node-localstorage":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40-iv-202404120107_1712909711730_0.2942531119896814","host":"s3://npm-registry-packages"}},"9.6.40-beta-202404242030":{"name":"dynamsoft-javascript-barcode","version":"9.6.40-beta-202404242030","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40-beta-202404242030","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"20de31766aebf01258c3da48e198aeade6496ff8","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40-beta-202404242030.tgz","fileCount":24,"integrity":"sha512-bSLEIyxYVud6KNnAxgZX02vWC4CDGqNzjxGMU4VUbvlTNW0QuE1lwCdBtjuIH8Q2pW3CRX+GG6KGZlEexOnMxg==","signatures":[{"sig":"MEUCIQCrzFnVxKrcnLplS/xeGt3zQl/5VO1QBH/Qto5Mim5k4gIgYs/bS2VQ9hp65i6tWQAL9/0rVaIg5D6YpDSusOdi23s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661291},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.40&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.40&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.40&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.40&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.40&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.40&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.40&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40-beta-202404242030_1714015915797_0.41709872702891615","host":"s3://npm-registry-packages"}},"9.6.40-beta-202404242342":{"name":"dynamsoft-javascript-barcode","version":"9.6.40-beta-202404242342","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.40-beta-202404242342","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"c5055a637d927ba6e61bea0d8db67fad1065476f","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.40-beta-202404242342.tgz","fileCount":24,"integrity":"sha512-0t2vOSGf4HHXfRYb3EYz5heki4qvWVth0LQtLnQ9JH3SgABnFFbvo2M+OA/wfA/UbxcAW8ARgop036x7wwx99A==","signatures":[{"sig":"MEYCIQDfZ9n+pHh2orAM2f/XBAZ9nnDaKf8OPgDzv9ZhfI9DQwIhAJ88NBPm5wM23ohSEKPYxoPVhD4caO+V9Jm1Yj5E50Yw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661291},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.40&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.40&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.40/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.40/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.40&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.40&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.40/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.40&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.40/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.40&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.40/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.40&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.40&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.40).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.40&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.40&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.40-beta-202404242342_1714027427951_0.23018682477265417","host":"s3://npm-registry-packages"}},"9.6.41-beta-202404250044":{"name":"dynamsoft-javascript-barcode","version":"9.6.41-beta-202404250044","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.41-beta-202404250044","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"34de14a051c07b82cb16350072cd2f77a71ae779","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.41-beta-202404250044.tgz","fileCount":24,"integrity":"sha512-hjsi1FmZ0Pi65l3SCMR1kj/lPW4eOejI7S/DXsPUn2zot2zaYeT99vyfD69xD9JPFtjy/qNR+uuD9Q+3CEIdQw==","signatures":[{"sig":"MEYCIQCwMAfNQ9dS5kqX2bkktJq1n+jaTuDVI/B+ct9taGz9mAIhAPT28gvOXore1D19JdxZJ9JB4IYpE8zumifM0eWpsbHR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661291},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.41&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.41&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.41&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.41&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.41/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.41&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.41&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.41/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.41/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.41&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.41/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.41&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.41/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.41/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.41&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.41&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.41/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.41/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.41&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.41/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.41&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.41/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.41&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.41&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.41](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.41).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.41&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.41&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"^0.1.15","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.41-beta-202404250044_1714031140006_0.6494904236197256","host":"s3://npm-registry-packages"}},"9.6.41":{"name":"dynamsoft-javascript-barcode","version":"9.6.41","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.41","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"b80eec5585b50e45d549bce7adf0639f41a85ca4","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.41.tgz","fileCount":24,"integrity":"sha512-Miv2wedQroHVSFcdp59HU6tstOJY1ScHVxFpzGECIwHbP07h0aEBj8ivgh2/JGzOftU/XaFl0AMj1t++k7CceQ==","signatures":[{"sig":"MEUCIG1DrdnhZ/kkr2WODGfq/dzv6+/OfgPiZUmF3u49ow74AiEA0GGvFWLN6JThm/uWzn4cthwFVUmRjh6WUO+BdeIeOME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661274},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.41_1714039757152_0.11258548904748267","host":"s3://npm-registry-packages"}},"9.6.42-beta-202404252029":{"name":"dynamsoft-javascript-barcode","version":"9.6.42-beta-202404252029","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.42-beta-202404252029","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"c5223545914a29aa4ce1ea71da35c3eacaffacd2","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.42-beta-202404252029.tgz","fileCount":24,"integrity":"sha512-qF5mabDAOslkRNdD5Hwjv59Tb+z4WOZYd6L3rTWwPBxmaKxVvXR1S0ToHTTi8hvzYdMA750Tq8fy/peWQXU1Qw==","signatures":[{"sig":"MEUCIGnKW6qkjvupiPBGMJaDOSEWlmJm/SSGSQHy7eMMKi4GAiEAu6l3lR8D1xvXyiEwV9xYSFbtSjrnZk2vzdtzMflJ+jA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661290},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.42&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.42&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.42&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode\r\n  ```\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm install dynamsoft-javascript-barcode --save\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js).\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.42&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.42&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.42&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.42&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.42-beta-202404252029_1714102209383_0.1666234228247485","host":"s3://npm-registry-packages"}},"9.6.42":{"name":"dynamsoft-javascript-barcode","version":"9.6.42","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.42","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"47538f0f0bd9c256c690c4a46106be464530df14","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.42.tgz","fileCount":24,"integrity":"sha512-aLb+zUv0l1/kZKJxCGSDU3iZTSIyxjhsK2pPBr2abGcakMGArhkCgOWZGPGDGQ5JsKvUM70MUlUs9C1H7dQbjw==","signatures":[{"sig":"MEQCIHakrG97c6QYV1YgyjA56s6D6/U1Djp4/cz6ncil+ZmcAiAaHl7c+P5shRpCSSW/lJyuDv7U6QOY2/6m9zEFN/FAfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18661274},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"6.14.16","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"12.22.12","dependencies":{"dm-howler":"^2.2.4","dynamsoft-camera-enhancer":"3.3.10-beta-202404222209"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.42_1714108585299_0.7174447713982652","host":"s3://npm-registry-packages"}},"9.6.42-beta-202406040227":{"name":"dynamsoft-javascript-barcode","version":"9.6.42-beta-202406040227","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.42-beta-202406040227","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"fb5e9467efbeaf5aadf166c2a22277083a5e8b3b","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.42-beta-202406040227.tgz","fileCount":24,"integrity":"sha512-9wm/XYBbaxMnGIy6/ENqB6UanluGBf4mnvmDK5gojtTAXv5+m7LyAMS5gx9l2i/PjeEwuTqdCzRqIhjinB2Anw==","signatures":[{"sig":"MEUCIC2Zy6MQ7iuDsDmI98ZxScbdugUGioZdMzWJviQ9XuIWAiEA8W1Eom2h0CSl3rrHjv3k3Xrz72bIxlFlyiEMSAlmpRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18526219},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.42&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.42&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.42&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm i dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the <a href=\"https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js\" target=\"_blank\">Request a Trial License</a> link.\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.42&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.42&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.42&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.42&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dynamsoft-camera-enhancer":"3.3.10-beta-202406040017"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.42-beta-202406040227_1717493295979_0.2340856156169393","host":"s3://npm-registry-packages"}},"9.6.42-beta-202406040303":{"name":"dynamsoft-javascript-barcode","version":"9.6.42-beta-202406040303","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.42-beta-202406040303","maintainers":[{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},{"name":"dynamsoft_jerson","email":"jerson@dynamsoft.com"},{"name":"dynamsoft_henry","email":"henry@dynamsoft.com"},{"name":"yushulx","email":"lingxiao1002@gmail.com"},{"name":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"a5a23805373aadf7c8f3e7af8eba200430c598e1","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.42-beta-202406040303.tgz","fileCount":24,"integrity":"sha512-geMcWYQHBAA77WF8EPMfLDH6Zr04irCvATwZxQBVUznxdZIRBs/KITHlkrpoj2+tV+Eg9LYs9cKglyLjqj9Tjg==","signatures":[{"sig":"MEUCIGwLs7prRISzZp7FkexRZlhGkpBTYlLvJiVPkLEgLMd0AiEAgYXZcafG1r7JJ72R20bZZchgSC/pHmhkiXTDPejPgRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18526069},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.42&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.42&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.42&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm i dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the <a href=\"https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js\" target=\"_blank\">Request a Trial License</a> link.\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.42&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.42&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.42&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.42&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dynamsoft-camera-enhancer":"3.3.10-beta-202406040017"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.42-beta-202406040303_1717495481606_0.33076538485982265","host":"s3://npm-registry-packages"}},"9.6.42-beta-202406210208":{"name":"dynamsoft-javascript-barcode","version":"9.6.42-beta-202406210208","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","_id":"dynamsoft-javascript-barcode@9.6.42-beta-202406210208","maintainers":[{"name":"Dynamsoft","email":"support@dynamsoft.com"}],"homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"dist":{"shasum":"72642dd69f46856651956d222f52577a5940e4b5","tarball":"https://registry.npmjs.org/dynamsoft-javascript-barcode/-/dynamsoft-javascript-barcode-9.6.42-beta-202406210208.tgz","fileCount":24,"integrity":"sha512-yUX/dFcLHc+ZvwxMwXI1tCWtQmzRvAiYCcBh0/hm9inqx65xT00m9DKEtDYdpRluIIT2nyAQy8wMfg4o+UlFqQ==","signatures":[{"sig":"MEUCICe4DYc/jrn9WE/NrLtvfcy88jvLbON6KQoqtCbFjG4SAiEAlFxo2Ni+N6uPXhFPmROTgtnPq1FVt+aeCHQtRJmpexk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18526276},"main":"./dist/dbr.pure.js","type":"module","types":"./dist/dbr.d.ts","module":"./dist/dbr.pure.esm.js","readme":"# Barcode Reader for Your Website - User Guide\r\n\r\n[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.\r\n\r\n![version](https://img.shields.io/npm/v/dynamsoft-javascript-barcode.svg)\r\n![downloads](https://img.shields.io/npm/dm/dynamsoft-javascript-barcode.svg)\r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/dynamsoft-javascript-barcode.svg)\r\n![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/dynamsoft-javascript-barcode.svg)\r\n\r\nOnce the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input.\r\n\r\n<video controls width=\"400\" autoplay=\"false\">\r\n    <source src=\"https://tst.dynamsoft.com/public/docs/dbr/javascript/How%20to%20Use%20Dynamsoft%20Barcode%20Reader%20JavaScript%20SDK%20v1.1.mp4\">\r\n</video>\r\n\r\nIn this guide, you will learn step by step on how to integrate the DBR-JS SDK into your website.\r\n\r\n<span style=\"font-size:20px\">Table of Contents</span>\r\n\r\n- [Hello World - Simplest Implementation](#hello-world---simplest-implementation)\r\n  - [Understand the code](#understand-the-code)\r\n  - [Run the example](#run-the-example)\r\n- [Building your own page](#building-your-own-page)\r\n  - [Include the SDK](#include-the-sdk)\r\n  - [Configure the SDK](#configure-the-sdk)\r\n  - [Interact with the SDK](#interact-with-the-sdk)\r\n  - [Customize the UI (optional)](#customize-the-ui-optional)\r\n- [API Documentation](#api-documentation)\r\n- [System Requirements](#system-requirements)\r\n- [How to Upgrade](#how-to-upgrade)\r\n- [Release Notes](#release-notes)\r\n- [Next Steps](#next-steps)\r\n\r\n**Popular Examples**\r\n\r\n- Hello World - [Guide](#hello-world---simplest-implementation) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html)\r\n- Angular App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-angular.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/3.read-video-angular)\r\n- React App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-reactjs.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/4.read-video-react)\r\n- Vue App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-vuejsv3.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/6.read-video-vue3)\r\n- PWA App - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/helloworld-pwa.html?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/10.read-video-pwa)\r\n- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/1.hello-world/14.read-video-webview)\r\n- Read Driver Licenses - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-and-parse-AAMVA.html?ver=9.6.42&utm_source=npm&&lang=js) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/2.read-a-drivers-license.html)\r\n- Fill A Form - [Guide](https://www.dynamsoft.com/barcode-reader/docs/core/programming/usecases/scan-barcodes-as-input.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/4.use-case/1.fill-a-form-with-barcode-reading.html)\r\n- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/4.use-case/3.show-result-texts-on-the-video.html)\r\n- Debug Camera and Collect Video Frame - [Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/debug.html?lang=js&&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/5.others/debug)\r\n\r\nYou can also:\r\n\r\n- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=9.6.42&utm_source=npm) \\| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/)\r\n- Try Online Examples - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v9.6.42/)\r\n\r\n## Hello World - Simplest Implementation\r\n\r\nLet's start with the \"Hello World\" example of the DBR-JS SDK which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream.  \r\n\r\n- Basic Requirements\r\n  - Internet connection\r\n  - [A supported browser](#system-requirements)\r\n  - Camera access\r\n\r\n### Understand the code\r\n\r\nThe complete code of the \"Hello World\" example is shown below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<body>\r\n    <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n    <script>\r\n        // Specifies a license, you can visit https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js to get your own trial license good for 30 days. \r\n        Dynamsoft.DBR.BarcodeScanner.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';\r\n        // Initializes and uses the SDK\r\n        (async () => {\r\n            let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n            scanner.onFrameRead = results => {\r\n                if (results.length > 0) console.log(results);\r\n            };\r\n            scanner.onUniqueRead = (txt, result) => {\r\n                alert(txt);\r\n            };\r\n            await scanner.show();\r\n        })();\r\n    </script>\r\n</body>\r\n\r\n</html>\r\n```\r\n\r\n<p align=\"center\" style=\"text-align:center; white-space: normal; \">\r\n  <a target=\"_blank\" href=\"https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v9.6.42/1.hello-world/1.hello-world.html\" title=\"Code in Github\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg\" alt=\"Code in Github\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run via JSFiddle\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg\" alt=\"Run via JSFiddle\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\" >\r\n  </a>\r\n  <!--\r\n  &nbsp;\r\n  <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\" style=\"text-decoration:none;\">\r\n    <img src=\"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg\" alt=\"Run in Dynamsoft\" width=\"20\" height=\"20\" style=\"width:20px;height:20px;\">\r\n  </a>-->\r\n</p>\r\n\r\n-----\r\n\r\n#### About the code\r\n\r\n- The DBR-JS SDK is included in the code via the **jsDelivr** CDN.\r\n\r\n> In some rare cases, you might not be able to access the CDN. If this happens, you can use [https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js](https://download2.dynamsoft.com/dbr/dynamsoft-barcode-reader-js/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js) for the test. However, please DO NOT use CDN of `download2.dynamsoft.com` in your production application because it is temporary. Instead, you can try [hosting the SDK yourself](#host-the-sdk-yourself).\r\n\r\n- `license`: This property specifies a license key. Note that the license \"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9\" used in this example is an online license and requires network connection to work. Read more on [Specify the license](#specify-the-license).\r\n\r\n- `createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices\" title=\"MediaDevices interface\">MediaDevices interface</a>.\r\n\r\n- `onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.\r\n\r\n- `onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.\r\n\r\n- `show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning.\r\n\r\n### Run the example\r\n\r\nYou can run the example deployed to <a target=\"_blank\" href=\"https://demo.dynamsoft.com/Samples/DBR/JS/1.hello-world/1.hello-world.html?ver=9.6.42&utm_source=npm\" title=\"Run in Dynamsoft\">the Dynamsoft Demo Server</a> or test it with <a target=\"_blank\" href=\"https://jsfiddle.net/DynamsoftTeam/pL4e7yrd/\" title=\"Run in JSFiddle\">JSFiddle code editor</a>. You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.\r\n\r\nWhen a barcode is decoded, you will see the result text pop up and the barcode location will be highlighted in the video feed.\r\n\r\nAlternatively, you can make a local test simply by taking the code in step 1, pasting it in a file with the name \"hello-world.html\" and open it in a browser.\r\n\r\n*Note*:\r\n\r\nIf you open the web page as `file:///` or `http://` , the camera may not work correctly because the API <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\" title=\"getUserMedia\">getUserMedia</a> usually requires HTTPS to access the camera.\r\n\r\nTo make sure your web application can access the camera, please configure your web server to support HTTPS. The following links may help.\r\n\r\n1. NGINX: <a target=\"_blank\" href=\"https://nginx.org/en/docs/http/configuring_https_servers.html\" title=\"Configuring HTTPS servers\">Configuring HTTPS servers</a>\r\n2. IIS: <a target=\"_blank\" href=\"https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/\" title=\"Create a Self Signed Certificate in IIS\">Create a Self Signed Certificate in IIS</a>\r\n3. Tomcat: <a target=\"_blank\" href=\"https://dzone.com/articles/setting-ssl-tomcat-5-minutes\" title=\"Setting Up SSL on Tomcat in 5 minutes\">Setting Up SSL on Tomcat in 5 minutes</a>\r\n4. Node.js: <a target=\"_blank\" href=\"https://nodejs.org/docs/v0.4.1/api/tls.html\" title=\"npm tls\">npm tls</a>\r\n\r\nIf the test doesn't go as expected, you can [contact us](https://www.dynamsoft.com/contact/?ver=9.6.42&utm_source=npm).\r\n\r\n## Building your own page\r\n\r\n### Include the SDK\r\n\r\n#### Use a public CDN\r\n\r\nThe simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The \"hello world\" example above uses **jsDelivr**.\r\n\r\n- jsDelivr\r\n\r\n  ```html\r\n  <script src=\"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n- UNPKG  \r\n\r\n  ```html\r\n  <script src=\"https://unpkg.com/dynamsoft-javascript-barcode@9.6.42/dist/dbr.js\"></script>\r\n  ```\r\n\r\n#### Host the SDK yourself\r\n\r\nBesides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.\r\n\r\nOptions to download the SDK:\r\n\r\n- From the website\r\n\r\n  <a target=\"_blank\" href=\"https://www.dynamsoft.com/barcode-reader/downloads/?ver=9.6.42&utm_source=npm\" title=\"Download the JavaScript Package\">Download the JavaScript Package</a>\r\n\r\n- npm\r\n\r\n  ```cmd\r\n  npm i dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\n- yarn\r\n\r\n  ```cmd\r\n  yarn add dynamsoft-javascript-barcode -E\r\n  ```\r\n\r\nDepending on how you downloaded the SDK and how you intend to use it, you can typically include it like this:\r\n\r\n```html\r\n<script src=\"/dynamsoft-barcode-reader-js-9.6.42/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"/node_modules/dynamsoft-javascript-barcode/dist/dbr.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```typescript\r\nimport { BarcodeScanner } from 'dynamsoft-javascript-barcode';\r\n```\r\n\r\n**NOTE**\r\n\r\n* Some older web application servers do not set `.wasm` mimetype as `application/wasm`. Upgrade your web application servers, or define the mimetype yourselves:\r\n  * [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings)\r\n  * [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap)\r\n  * [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types)\r\n\r\n* To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application.\r\n\r\n  ```cmd\r\n  Cache-Control: max-age=31536000\r\n  ```\r\n\r\n  Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).\r\n\r\n### Configure the SDK\r\n\r\nBefore using the SDK, you need to configure a few things.\r\n\r\n#### Specify the license\r\n\r\nThe SDK requires a license to work, use the API `license` to specify a license key.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\n```\r\n\r\nTo test the SDK, you can request a 30-day trial license via the <a href=\"https://www.dynamsoft.com/customer/license/trialLicense?ver=9.6.42&utm_source=npm&product=dbr&package=js\" target=\"_blank\">Request a Trial License</a> link.\r\n\r\n> If you register a Dynamsoft account and download the SDK from the official website, Dynamsoft will automatically generate a 30-day trial license for you, and put the license key into all the samples attached to the SDK.\r\n\r\n#### Specify the location of the \"engine\" files\r\n\r\nThis is usually only required with frameworks like Angular or React, etc. where dbr.js is compiled into another file.\r\n\r\nThe purpose is to tell the SDK where to find the engine files (\\*.worker.js, \\*.wasm.js and \\*.wasm, etc.). The API is called `engineResourcePath`:\r\n\r\n```javascript\r\n//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files\r\nDynamsoft.DBR.BarcodeScanner.engineResourcePath = \"https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.42/dist/\";\r\n```\r\n\r\n### Interact with the SDK\r\n\r\n#### Create a `BarcodeScanner` object\r\n\r\nYou can use one of two classes ( `BarcodeScanner` and `BarcodeReader` ) to interact with the SDK. `BarcodeReader` is a low-level class that processes images directly. `BarcodeScanner` , on the other hand, inherits from `BarcodeReader` and provides high-level APIs and a built-in GUI to allow continuous barcode scanning on video frames. We'll focus on `BarcodeScanner` in this guide.\r\n\r\nTo use the SDK, we first create a `BarcodeScanner` object.\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet scanner = null;\r\ntry {\r\n    scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n} catch (ex) {\r\n    console.error(ex);\r\n}\r\n```\r\n\r\nTip: When creating a `BarcodeScanner` object within a function which may be called more than once, it's best to use a \"helper\" variable to avoid double creation such as `pScanner` in the following code\r\n\r\n```javascript\r\nDynamsoft.DBR.BarcodeScanner.license = \"YOUR-LICENSE-KEY\";\r\nlet pScanner = null;\r\ndocument.getElementById('btn-scan').addEventListener('click', async () => {\r\n    try {\r\n        const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());\r\n    } catch (ex) {\r\n        console.error(ex);\r\n    }\r\n});\r\n```\r\n\r\n#### Customize the `BarcodeScanner` Settings (optional)\r\n\r\nLet's take a look at the following code snippets:\r\n\r\n```javascript\r\n// Sets which camera and what resolution to use\r\nlet allCameras = await scanner.getAllCameras();\r\nawait scanner.setCurrentCamera(allCameras[0].deviceId);\r\nawait scanner.setResolution(1280, 720);\r\n```\r\n\r\n```javascript\r\n// Sets up the scanner behavior\r\nlet scanSettings = await scanner.getScanSettings();\r\n// Disregards duplicated results found in a specified time period (in milliseconds).\r\nscanSettings.duplicateForgetTime = 5000; // The default is 3000\r\n// Sets a scan interval in milliseconds so the SDK may release the CPU from time to time.\r\n// (setting this value larger is a simple way to save battery power and reduce device heating).\r\nscanSettings.intervalTime = 100; // The default is 0.\r\n// Sets captureAndDecodeInParallel to false, which tells the SDK not to acquire the next frame while decoding the first.\r\n// This is another way to save battery power and is recommended on low-end phones. However, it does slow down the decoding speed.\r\nscanSettings.captureAndDecodeInParallel = false; // The default is true.\r\nawait scanner.updateScanSettings(scanSettings);\r\n```\r\n\r\n```javascript\r\n// Uses one of the built-in RuntimeSetting templates: \"single\" (decode a single barcode, the default mode), \"speed\", \"balance\", \"coverage\", \"dense\" and \"distance\"\r\nawait scanner.updateRuntimeSettings(\"speed\");\r\n\r\n// Makes changes to the template. The code below demonstrates how to specify enabled symbologies\r\nlet runtimeSettings = await scanner.getRuntimeSettings();\r\nruntimeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED | Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;\r\nawait scanner.updateRuntimeSettings(runtimeSettings);\r\n```\r\n\r\n[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/yfkcajxz/)\r\n\r\nAs you can see from the above code snippets, there are three types of configurations:\r\n\r\n- Customize the data source: This configuration includes which camera to use, the preferred resolution, etc. Learn more <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n- `get/updateScanSettings`: Configures the behavior of the scanner which includes `duplicateForgetTime` and `intervalTime`, etc.\r\n\r\n- `get/updateRuntimeSettings`: Configures the decode engine with either a built-in template or a comprehensive `RuntimeSettings` object. For example, the following uses the built-in \"speed\" settings with updated `localizationModes`.\r\n\r\n  ```javascript\r\n  await barcodeScanner.updateRuntimeSettings(\"speed\");\r\n  //await barcodeScanner.updateRuntimeSettings(\"balance\"); //alternative\r\n  //await barcodeScanner.updateRuntimeSettings(\"coverage\"); //alternative\r\n  let settings = await barcodeScanner.getRuntimeSettings();\r\n  settings.localizationModes = [\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_CONNECTED_BLOCKS,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_SCAN_DIRECTLY,\r\n      Dynamsoft.DBR.EnumLocalizationMode.LM_LINES, 0, 0, 0, 0, 0\r\n  ];\r\n  await barcodeScanner.updateRuntimeSettings(settings);\r\n  ```\r\n\r\n  Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/).\r\n\r\n  See also [settings samples](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/parameter-settings.html?ver=9.6.42&utm_source=npm).\r\n\r\n> Find the full list of the runtime settings <a href=\"https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/global-interfaces.html?ver=9.6.42&utm_source=npm&&ver=latest#runtimesettings\" target=\"_blank\" title=\"here\">here</a>.\r\n\r\n### Customize the UI (optional)\r\n\r\nThe built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr.ui.html` . There are a few ways to customize it:\r\n\r\n#### Modify the file `dist/dbr.ui.html` directly\r\n\r\n  This option is only possible when you [Host the SDK yourself](#host-the-sdk-yourself) instead of using a public CDN.\r\n\r\n#### Copy the file `dist/dbr.ui.html` to your application, modify it and use the the API `defaultUIElementURL` to set it as the default UI\r\n\r\n  ```javascript\r\n  // This line only takes effect before the method `createInstance()` is called.\r\n  Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = \"THE-URL-TO-THE-FILE\";\r\n  ```\r\n\r\n#### Append the default UI element to your page, customize it before showing it\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\"></div>\r\n  ```\r\n\r\n  ```javascript\r\n  document.getElementById('div-ui-container').appendChild(scanner.getUIElement());\r\n  document.getElementsByClassName('dce-btn-close')[0].hidden = true; // Hide the close button\r\n  ```\r\n\r\n#### Build the UI element from scratch and connect it to the SDK with the API `setUIElement(HTMLElement)`\r\n\r\n1. **Embed the video**\r\n  \r\n  ```html\r\n  <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  <script>\r\n      (async () => {\r\n          let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();\r\n          await scanner.setUIElement(document.getElementById('div-ui-container'));\r\n          scanner.onFrameRead = results => {\r\n              console.log(results);\r\n          };\r\n          scanner.onUniqueRead = (txt, result) => {\r\n              alert(txt);\r\n          };\r\n          await scanner.show();\r\n      })();\r\n  </script>\r\n  ```\r\n\r\n  > The video element will be created and appended to the DIV element with the class `dce-video-container` , make sure the class name is the same. Besides, the CSS property `position` of the DIV element must be either `relative` , `absolute` , `fixed` , or `sticky` .\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/2jzeq1r6/)\r\n\r\n2. **[Optional] Add the camera list and resolution list**\r\n\r\n  If the class names of the created select elements match the default class names, i.e. `dce-sel-camera` and `dce-sel-resolution` respectively, the SDK will automatically populate the lists and handle the camera/resolution switching.\r\n\r\n  ```html\r\n    <div id=\"div-ui-container\" style=\"width:100%;height:100%;\">\r\n        <select class=\"dce-sel-camera\"></select><br>\r\n        <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n    </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/nbj75vxu/)\r\n\r\n  ```html\r\n  <div id=\"div-ui-container\">\r\n      <select class=\"dce-sel-camera\"></select>\r\n      <select class=\"dce-sel-resolution\"></select>\r\n      <br>\r\n      <div class=\"dce-video-container\" style=\"position:relative;width:100%;height:500px;\"></div>\r\n  </div>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/25v08paf/)\r\n\r\n  > By default, only 3 hard-coded resolutions (1920 x 1080, 1280 x 720，640 x 480) are populated as options. You can show a customized set of options by hardcoding them.\r\n\r\n  ```html\r\n  <select class=\"dce-sel-resolution\">\r\n      <option class=\"dce-opt-gotResolution\" value=\"got\"></option>\r\n      <option data-width=\"1280\" data-height=\"720\">1280x720</option>\r\n      <option data-width=\"1920\" data-height=\"1080\">1920x1080</option>\r\n  </select>\r\n  ```\r\n\r\n  [Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/tnfjks4q/)\r\n\r\n  > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the closest supported resolution. As a result, the selected resolution may not be the actual resolution. In this case, add an option with the class name `dce-opt-gotResolution` (as shown above) and the SDK will automatically use it to show the **actual resolution**.\r\n\r\n  See the section of the Explore Features guide on [UI customization]({{site.features}}customize-the-ui.html?lang=js) to learn more.\r\n\r\n## API Documentation\r\n\r\nYou can check out the detailed documentation about the APIs of the SDK at\r\n[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=9.6.42).\r\n\r\n## System Requirements\r\n\r\nDBR requires the following features to work:\r\n\r\n- Secure context (HTTPS deployment)\r\n\r\n  When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons\r\n  \r\n  - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.\r\n  > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.\r\n  \r\n  - Dynamsoft License requires a secure context to work.\r\n\r\n- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`\r\n\r\n  The above four features are required for the SDK to work.\r\n\r\n- `MediaDevices`/`getUserMedia`\r\n\r\n  This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeScanner.html?ver=9.6.42&utm_source=npm#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.\r\n\r\n- `getSettings`\r\n\r\n  This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties.\r\n\r\nThe following table is a list of supported browsers based on the above requirements:\r\n\r\n  Browser Name | Version\r\n  :-: | :-:\r\n  Chrome | v59+<sup>1</sup>\r\n  Firefox | v52+ (v55+ on Android/iOS<sup>1</sup>)\r\n  Edge<sup>2</sup> | v16+\r\n  Safari<sup>3</sup> | v11+\r\n\r\n  <sup>1</sup> iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews.\r\n\r\n  <sup>2</sup> On Edge, due to strict Same-origin policy, you must host the SDK files on the same domain as your web page.\r\n  \r\n  <sup>3</sup> Safari v11.x already has the required features, but it has many other issues, so we recommend v12+.\r\n\r\nApart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.\r\n\r\n## How to Upgrade\r\n\r\nIf you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/?ver=9.6.42&utm_source=npm).\r\n\r\n## Release Notes\r\n\r\nLearn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/?ver=latest).\r\n\r\n## Next Steps\r\n\r\nNow that you have got the SDK integrated, you can choose to move forward in the following directions\r\n\r\n1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=latest)\r\n2. Learn how to make use of the [SDK features](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/explore-features/index.html?ver=latest)\r\n3. See how the SDK works in [Popular Use Cases](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-cases/index.html?ver=latest)\r\n","exports":{"import":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.esm.js"},"require":{"types":"./dist/dbr.d.ts","default":"./dist/dbr.pure.js"}},"private":false,"scripts":{"build":"rollup -c --environment BUILD:production","makeZip":"makeZip --package=dynamsoft-barcode-reader --version=auto --sampleBranch=9.x --structure=old","build-dev":"rollup -c --environment BUILD:development","build:doc":"typedoc","update:iv":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=internalVersion --tag=iv","update:dev":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=development --tag=latest","easyPublish":"npm run update:dev && npm run build-dev && npm publish","update:beta":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=beta --tag=beta","update:prod":"updatePackage --package=dynamsoft-javascript-barcode --version=auto --env=production --tag=latest","update:readme":"updateReadme --package=dynamsoft-barcode-reader --version=auto --branch=preview --html","updateDCE:dev":"updateImportedPkg --package=dynamsoft-camera-enhancer --dev","updateDCE:prod":"updateImportedPkg --package=dynamsoft-camera-enhancer --no-dev","updateLink:npm":"updateLink --source=npm","updateLink:zip":"updateLink --source=zip","updateLink:github":"updateLink --source=github"},"_npmUser":{"name":"dm_npm_publisher","email":"github@dynamsoft.com"},"deprecated":"This package is deprecated. Please use 'dynamsoft-barcode-reader-bundle' instead: https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle","repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"_npmVersion":"8.19.4","description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"dynamsoft-camera-enhancer":"3.3.10-beta-202406040017"},"publishConfig":{"tag":"beta","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.6.2","rollup":"^3.29.4","fs-extra":"^8.1.0","typescript":"^4.9.5","mutable-promise":"^1.1.13","rollup-plugin-dts":"^6.1.0","@scannerproxy/dlsjs":"^3.0.20","@rollup/plugin-terser":"^0.4.4","@dynamsoft/rd2-scripts":"0.1.17","@rollup/plugin-replace":"^5.0.5","detect-browser-node-ssr":"^3.0.2","@rollup/plugin-typescript":"^11.1.6","@scannerproxy/browser-info":"^2.0.8","@rollup/plugin-node-resolve":"^15.0.1","@scannerproxy/curscript-path":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dynamsoft-javascript-barcode_9.6.42-beta-202406210208_1718960995118_0.47970651446235424","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-12-20T05:29:56.511Z","modified":"2026-09-16T01:48:18.478Z","6.4.1":"2018-12-20T05:29:56.808Z","6.4.2":"2018-12-20T05:49:40.153Z","6.5.1":"2019-04-19T09:23:14.467Z","6.5.2":"2019-04-28T03:17:39.733Z","6.5.3":"2019-04-29T01:36:36.882Z","6.5.4":"2019-06-14T00:54:23.569Z","7.0.0":"2019-08-09T07:55:09.332Z","7.1.0-beta.1":"2019-08-27T08:55:42.420Z","7.1.0":"2019-08-30T07:36:58.304Z","7.1.1":"2019-09-12T02:07:48.482Z","7.1.2":"2019-10-21T07:42:59.354Z","7.1.3":"2019-10-24T02:45:28.006Z","7.2.2-v2":"2019-11-27T02:06:18.552Z","7.2.3-v2":"2019-12-24T01:55:50.799Z","7.3.0-v0":"2020-01-15T00:53:30.010Z","7.3.0-v1":"2020-01-20T09:00:38.441Z","7.3.0-v2":"2020-02-14T07:09:16.484Z","7.3.0-v3":"2020-04-02T02:44:47.545Z","7.3.0-v4":"2020-04-02T08:01:52.819Z","7.4.0-v0":"2020-05-12T09:24:46.471Z","7.4.0-v1":"2020-05-18T08:34:23.749Z","7.5.0-v0":"2020-08-03T05:43:55.226Z","7.5.0-v1":"2020-08-03T07:56:59.009Z","7.6.0":"2020-09-01T05:38:19.714Z","8.0.0":"2020-11-25T07:48:28.533Z","8.1.0":"2021-01-19T07:15:22.645Z","8.1.2":"2021-01-22T08:06:44.334Z","8.1.3":"2021-03-04T08:19:21.016Z","8.2.0":"2021-03-17T08:54:29.761Z","8.2.1":"2021-03-29T07:24:17.121Z","8.2.3":"2021-04-15T05:06:18.165Z","8.2.5":"2021-05-18T03:05:21.130Z","8.2.7":"2021-06-08T06:30:15.461Z","8.2.9":"2021-06-08T07:58:19.261Z","8.2.11":"2021-06-08T08:01:09.722Z","8.4.0":"2021-06-29T05:43:18.881Z","8.6.0":"2021-08-31T08:00:37.430Z","8.6.1":"2021-09-01T08:33:15.556Z","8.6.3":"2021-09-30T08:33:29.233Z","8.8.0":"2021-10-28T10:05:51.434Z","8.8.1":"2021-10-29T10:10:31.153Z","8.8.3":"2021-10-29T11:33:18.918Z","8.8.5":"2022-01-26T08:29:00.771Z","8.8.7":"2022-01-26T09:13:22.395Z","9.0.0":"2022-03-24T07:38:04.199Z","9.0.1":"2022-04-25T02:20:32.287Z","9.0.2":"2022-05-06T05:20:32.835Z","9.2.10-beta07270208":"2022-07-27T09:11:38.409Z","9.2.10-beta07271933":"2022-07-28T02:36:40.433Z","9.2.10-beta07272246":"2022-07-28T05:49:36.864Z","9.2.10":"2022-07-28T06:19:24.673Z","9.2.10-beta07280004":"2022-07-28T07:07:06.214Z","9.2.11-beta07280205":"2022-07-28T09:08:06.348Z","9.2.11":"2022-07-28T09:22:26.633Z","9.2.12-beta08032257":"2022-08-04T06:00:00.609Z","9.2.12-beta08032351":"2022-08-04T06:54:11.641Z","9.2.12":"2022-08-04T07:09:50.439Z","9.2.13-beta08100131":"2022-08-10T08:34:13.430Z","9.2.13":"2022-08-11T01:28:10.606Z","9.3.0-beta09252239":"2022-09-26T05:42:19.885Z","9.3.0":"2022-09-27T01:37:24.706Z","9.3.1-beta10082243":"2022-10-09T05:45:54.194Z","9.3.1-beta10092217":"2022-10-10T05:20:13.919Z","9.3.1":"2022-10-10T05:54:10.328Z","9.4.0-iv11082257":"2022-11-09T07:03:31.912Z","9.4.0-iv11082320":"2022-11-09T07:26:40.544Z","9.4.0-iv-202211222141":"2022-11-23T05:46:10.128Z","9.6.0-beta-202212130059":"2022-12-13T09:05:58.385Z","9.6.0-beta-202212130149":"2022-12-13T09:56:25.891Z","9.6.0":"2022-12-13T10:06:09.617Z","9.6.1-iv-202212150202":"2022-12-15T10:09:32.811Z","9.6.1-beta-202212182159":"2022-12-19T06:05:28.944Z","9.6.1":"2022-12-19T07:07:40.485Z","9.6.1-iv-202212230033":"2022-12-23T08:39:58.862Z","9.6.2-beta-202301140102":"2023-01-14T09:08:05.258Z","9.6.2":"2023-01-16T05:48:02.343Z","9.6.10-beta-202302201925":"2023-02-21T03:31:41.234Z","9.6.10-beta-202302202213":"2023-02-21T06:18:38.179Z","9.6.10":"2023-02-21T06:41:28.375Z","9.6.11-beta-202303121944":"2023-03-13T02:50:26.359Z","9.6.11-beta-202303122340":"2023-03-13T06:46:23.626Z","9.6.11":"2023-03-13T07:28:14.400Z","9.6.20-iv-202303280023":"2023-03-28T07:28:18.087Z","9.6.20-beta-202304120143":"2023-04-12T08:49:32.850Z","9.6.20-beta-202304171826":"2023-04-18T01:32:39.829Z","9.6.20-beta-202304172243":"2023-04-18T05:48:58.877Z","9.6.20":"2023-04-18T07:00:13.583Z","9.6.21-beta-202308022353":"2023-08-03T09:16:08.019Z","9.6.21":"2023-08-03T09:39:03.774Z","9.6.30-beta-202309130021":"2023-09-13T07:27:01.267Z","9.6.30":"2023-09-13T07:51:58.529Z","9.6.30-iv-202309261832":"2023-09-27T01:38:26.369Z","9.6.30-iv-202310102228":"2023-10-11T05:34:44.833Z","9.6.31-beta-202310112234":"2023-10-12T05:41:35.497Z","9.6.31":"2023-10-12T06:04:54.327Z","9.6.31-beta-202310191909":"2023-10-20T02:17:06.654Z","9.6.31-iv-202311010046":"2023-11-01T08:16:17.112Z","9.6.32-beta-202312061835":"2023-12-07T02:42:19.570Z","9.6.32":"2023-12-07T05:36:32.965Z","9.6.33-beta-202402032314":"2024-02-04T07:38:49.275Z","9.6.33":"2024-02-04T07:52:21.486Z","9.6.40-beta-202403141926":"2024-03-15T02:42:49.136Z","9.6.40-beta-202403142006":"2024-03-15T03:21:32.890Z","9.6.40":"2024-03-18T02:08:57.652Z","9.6.40-iv-202404120107":"2024-04-12T08:15:12.090Z","9.6.40-beta-202404242030":"2024-04-25T03:31:56.057Z","9.6.40-beta-202404242342":"2024-04-25T06:43:48.227Z","9.6.41-beta-202404250044":"2024-04-25T07:45:40.367Z","9.6.41":"2024-04-25T10:09:17.415Z","9.6.42-beta-202404252029":"2024-04-26T03:30:09.661Z","9.6.42":"2024-04-26T05:16:25.610Z","9.6.42-beta-202406040227":"2024-06-04T09:28:16.268Z","9.6.42-beta-202406040303":"2024-06-04T10:04:41.901Z","9.6.42-beta-202406210208":"2024-06-21T09:09:55.387Z"},"bugs":{"url":"https://github.com/dynamsoft/barcode-reader-javascript/issues"},"author":{"url":"https://www.dynamsoft.com","name":"Dynamsoft"},"license":"SEE LICENSE IN LICENSE","homepage":"https://www.dynamsoft.com/barcode-reader/sdk-javascript","keywords":["HTML5 barcode","JavaScript barcode","Web barcode","barcode","PDF417","QRCode","Aztec Code","WebAssembly","SDK","Linear barcode","1D barcode"],"repository":{"url":"git+https://github.com/dynamsoft/barcode-reader-javascript.git","type":"git"},"description":"Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR","maintainers":[{"email":"lingxiao1002@gmail.com","name":"yushulx"},{"email":"jerson@dynamsoft.com","name":"dynamsoft_jerson"},{"email":"github@dynamsoft.com","name":"dm_npm_publisher"},{"email":"ellie@dynamsoft.com","name":"ellie-dynamsoft"}],"readme":"","readmeFilename":""}