{"_id":"@4efficiency/react-barcode-reader","_rev":"2-a8298db334bc26d5de5a0428e7143759","name":"@4efficiency/react-barcode-reader","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@4efficiency/react-barcode-reader","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@4efficiency/react-barcode-reader@1.0.0","maintainers":[{"name":"remco4ef","email":"remco.blumink@4ef.nl"},{"name":"4efficency-admin","email":"beheerder4ef@outlook.com"},{"name":"evan4ef","email":"evan.bruno@4ef.nl"}],"dist":{"shasum":"e1a0da7f3688cbd6b8e86c28e8047274266867db","tarball":"https://registry.npmjs.org/@4efficiency/react-barcode-reader/-/react-barcode-reader-1.0.0.tgz","fileCount":4,"integrity":"sha512-/ia68HeNH6pG+nuvy1T9h3uwBKAMZ9qxVngMqDXlO79iNagEkWRrkwXbYYOrnkCdwmi/kOfkmSZNzfrS9foKhw==","signatures":[{"sig":"MEQCIDXupk255+Cw3nYuEXQqo9dCDcVw5Upxwl4Ljxe7E3EbAiBdrMzdlPYYo6f/e0v9rqpPyQpHAUl0keyLPeltwOBW6g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15455},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"fb2541fb848712d336c63267c5802d547a2cfb3f","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"remco4ef","email":"remco.blumink@4ef.nl"},"repository":{"url":"https://4ef.visualstudio.com/4EF%20Shared%20Libraries/_git/4ef-react-barcode-reader","type":"git"},"_npmVersion":"11.4.1","description":"A react component for reading barcodes and Qr codes from keybord input devices.","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/react":"^19.2.7","@types/react-dom":"^19.2.3"},"peerDependencies":{"react":">=19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/react-barcode-reader_1.0.0_1766156447222_0.8981387228560909","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@4efficiency/react-barcode-reader","version":"1.0.1","description":"A react component for reading barcodes and Qr codes from keybord input devices.","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build","lint":"eslint -c ./eslint.config.js ./src"},"peerDependencies":{"react":">=19.2.0"},"repository":{"type":"git","url":"https://4ef.visualstudio.com/4EF%20Shared%20Libraries/_git/4ef-react-barcode-reader"},"keywords":[],"author":{"name":"4EFficicncy Services"},"license":"MIT","type":"module","devDependencies":{"@types/react":"^19.2.7","@types/react-dom":"^19.2.3","typescript":"^5.9.3","eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.26","prettier":"^3.7.4","typescript-eslint":"^8.50.0"},"_id":"@4efficiency/react-barcode-reader@1.0.1","gitHead":"7c7df93be4a845eb8ff8600bd5ed93bda7364253","_nodeVersion":"22.12.0","_npmVersion":"11.4.1","dist":{"integrity":"sha512-FECUuyYdA950ogbGbrnk4VgS+JyEeRGySzqQ6IxTEIewS7TmxGfmEvHVbit5zkq/ovwZVtMUkqFVuv0VFf0zDQ==","shasum":"1ed442b91d15697ddd7fda9ab4dca3e3b11aaa8a","tarball":"https://registry.npmjs.org/@4efficiency/react-barcode-reader/-/react-barcode-reader-1.0.1.tgz","fileCount":4,"unpackedSize":15898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrB99WSE0zKhmufj1NVqDaTBaszwhwGc5ay4+GfldMMgIhANKesggQpHNwQ9gKYi6kRXF5LaDsVSQyBSgYOIrzzt4A"}]},"_npmUser":{"name":"remco4ef","email":"remco.blumink@4ef.nl"},"directories":{},"maintainers":[{"name":"remco4ef","email":"remco.blumink@4ef.nl"},{"name":"4efficency-admin","email":"beheerder4ef@outlook.com"},{"name":"evan4ef","email":"evan.bruno@4ef.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-barcode-reader_1.0.1_1768484362325_0.10583066692597076"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-19T15:00:47.036Z","modified":"2026-01-15T13:39:22.635Z","1.0.0":"2025-12-19T15:00:47.362Z","1.0.1":"2026-01-15T13:39:22.497Z"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"https://4ef.visualstudio.com/4EF%20Shared%20Libraries/_git/4ef-react-barcode-reader"},"description":"A react component for reading barcodes and Qr codes from keybord input devices.","maintainers":[{"name":"remco4ef","email":"remco.blumink@4ef.nl"},{"name":"4efficency-admin","email":"beheerder4ef@outlook.com"},{"name":"evan4ef","email":"evan.bruno@4ef.nl"}],"readme":"## Introduction\r\nA [React](https://facebook.github.io/react/) component for reading barcode and QR codes from devices that are represent as keyboard to the system.\r\n\r\nThis is a conversion to typescript fork of https://kybarg.github.io/react-barcode-reader/\r\n\r\n\r\n## Demo\r\nto come maybe\r\n\r\n## Install\r\n`npm install --save @4efficiency/react-barcode-reader`\r\n\r\n## Example\r\n\r\n```js\r\nimport React, {useState} from 'react'\r\nimport BarcodeReader from '@4efficiency/react-barcode-reader'\r\n\r\nconst Test  = ()=> {\r\n  const [result,setResult] = useState<string>(\"No result\")\r\n      \r\n    const handleScan = (data)=>{\r\n    setResult(data)\r\n  }\r\n  const handleError = (err) =>{\r\n    console.error(err)\r\n  }\r\n  \r\n\r\n    return(\r\n      <div>\r\n        <BarcodeReader\r\n          onError={handleError}\r\n          onScan={handleScan}\r\n          />\r\n        <p>{this.state.result}</p>\r\n      </div>\r\n    )\r\n    \r\n}\r\n```\r\n\r\n## Props\r\n| Prop | Type | Default Value | Description |\r\n|---|---|---|---|\r\n| onScan | func |  | Callback after detection of a successfull scanning (scanned string in parameter) |\r\n| onError | func |  | Callback after detection of a unsuccessfull scanning (scanned string in parameter) |\r\n| onReceive | func |  | Callback after receiving and processing a char (scanned char in parameter)\r\n| onKeyDetect | func |  | Callback after detecting a keyDown (key char in parameter) - in contrast to onReceive, this fires for non-character keys like tab, arrows, etc. too!\r\n| timeBeforeScanTest | number | 100 | Wait duration (ms) after keypress event to check if scanning is finished\r\n| avgTimeByChar | number | 30 | Average time (ms) between 2 chars. Used to do difference between keyboard typing and scanning\r\n| minLength | number | 6 | Minimum length for a scanning\r\n| endChar | [number] | [9, 13] | Chars to remove and means end of scanning\r\n| startChar | [number] | [] | Chars to remove and means start of scanning\r\n| scanButtonKeyCode | number |  | Key code of the scanner hardware button (if the scanner button a acts as a key itself)\r\n| scanButtonLongPressThreshold | number | 3 | How many times the hardware button should issue a pressed event before a barcode is read to detect a longpress\r\n| onScanButtonLongPressed | func |  | Callback after detection of a successfull scan while the scan button was pressed and held down\r\n| stopPropagation | bool | false | Stop immediate propagation on keypress event\r\n| preventDefault | bool | false | Prevent default action on keypress event\r\n| testCode | string |  | Test string for simulating\r\n| splitPattern |  RegExp | | Optional regexp to split scans into multiple events \r\n\r\n## Dev\r\n\r\n### Install dependencies\r\n`npm install`\r\n\r\n### Build\r\n`npm run build`\r\n\r\n\r\n### Test\r\n`npm test`\r\n\r\n### Linting\r\n`npm run lint`\r\n\r\n## License\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2025 4Efficiency Services B.V.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.","readmeFilename":"README.md","author":{"name":"4EFficicncy Services"}}