{"_id":"@cflorioluis/barcodereader","_rev":"3-9c980b06c1d1febef73d0d458caaf156","name":"@cflorioluis/barcodereader","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@cflorioluis/barcodereader","version":"0.1.0","keywords":["qr","barcode","scanner","wasm","rust","camera"],"license":"MIT","_id":"@cflorioluis/barcodereader@0.1.0","maintainers":[{"name":"cflorioluis","email":"cflorioluis@gmail.com"}],"dist":{"shasum":"96c30d92b3d383f38368db0c1b9903cde79427b2","tarball":"https://registry.npmjs.org/@cflorioluis/barcodereader/-/barcodereader-0.1.0.tgz","fileCount":13,"integrity":"sha512-dfL+1L4XmNTrMV0sr33q1H8bRAcTPJM/nYTfqy+qfDulSq/e0e+AfEIe5BEKgSxBT/WICrrxL5W22hu8FW4cNg==","signatures":[{"sig":"MEUCIQC2JS8aPlKUOCow4D/vtDJ0vZl2S5P3IxjkEfnmiNivMgIgJjDkO53dE+Gip60nDQZM/XASy8Dzaf6eekNlHX2dYrI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113499},"main":"js/index.js","type":"module","types":"js/index.d.ts","exports":{".":{"types":"./js/index.d.ts","default":"./js/index.js"}},"scripts":{"build":"npm run build:wasm && npm run build:js","build:js":"tsc -p tsconfig.json","test:core":"cargo test -p barcode-core","build:wasm":"wasm-pack build wasm --target web --out-dir pkg && rm -f wasm/pkg/.gitignore","prepublishOnly":"npm run build"},"_npmUser":{"name":"cflorioluis","email":"cflorioluis@gmail.com"},"_npmVersion":"12.0.1","description":"Dependency-free 1D/2D barcode & QR decoder. One Rust core, WASM for web (Angular/React/Vue/Electron/Capacitor), native FFI later.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/barcodereader_0.1.0_1783964511592_0.27736673775445975","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cflorioluis/barcodereader","version":"0.2.0","keywords":["qr","barcode","scanner","wasm","rust","camera"],"license":"MIT","_id":"@cflorioluis/barcodereader@0.2.0","maintainers":[{"name":"cflorioluis","email":"cflorioluis@gmail.com"}],"dist":{"shasum":"11c31e7be3a8b6aeb034aec7f64dfd9dbdb4f2c7","tarball":"https://registry.npmjs.org/@cflorioluis/barcodereader/-/barcodereader-0.2.0.tgz","fileCount":14,"integrity":"sha512-GPqOpHZaOWmJXwjobcfkt+4BUXT/F8uBqPg8p1RHux27pEXCBQtKA7yQrsQxRdhzM6xLGdXSDI+H8q0ashrckw==","signatures":[{"sig":"MEUCIQC6c8tRR9Djo4oCGA2y/7R2glGPQStLUdc9kdUWEg9bogIgBpKVG4XQZy6YSUXRm4b4unWVQ0Fz5cdx1zC9nSE87zw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFwsXJQ0duEo1H1IzJjaSbFZqKwhvzgW1QZumXQBSWKMAiAnoncm8Xl2yUck7jlq5OXuwNZo4yIQK7vFfpRYLt8A0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143422},"main":"js/index.js","type":"module","types":"js/index.d.ts","exports":{".":{"types":"./js/index.d.ts","default":"./js/index.js"}},"gitHead":"24933a19c6621af5d16eedff9da000dbb56a3eaa","scripts":{"build":"npm run build:wasm && npm run build:js","build:js":"tsc -p tsconfig.json","test:core":"cargo test -p barcode-core","build:wasm":"wasm-pack build wasm --target web --out-dir pkg && rm -f wasm/pkg/.gitignore","prepublishOnly":"npm run build"},"_npmUser":{"name":"cflorioluis","email":"cflorioluis@gmail.com"},"_npmVersion":"12.0.2","description":"Dependency-free 1D/2D barcode & QR decoder. One Rust core, WASM for web (Angular/React/Vue/Electron/Capacitor), native FFI later.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/barcodereader_0.2.0_1790338810335_0.8855637977354476","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@cflorioluis/barcodereader@0.2.1","dist":{"shasum":"9b65f4021afb64d9e6be35c6179746efa200d067","tarball":"https://registry.npmjs.org/@cflorioluis/barcodereader/-/barcodereader-0.2.1.tgz","fileCount":14,"integrity":"sha512-BSQ01D00LDrsDZ6yVe+2hL7u4AXyyWE4+gbuyT/mX+eDYnNFxBZa77cWa5PhM5jOPr6j5nBqoMxJeuGfeFLJKg==","signatures":[{"sig":"MEUCIQDL7Uml4NC/7MMeMp3fx0HYt8EHQunm7tNp73GSOT4JKAIgCq+PcuoEBhaDx3JfxxmhctwY7nH7Hj6XC16sXvIw65g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFkMrdY0K9sZn7ctD3aqsOEpU51v3iParGnURxlr+eDiAiEA/WhxOGymqWfM1pB08L9/q6NMVoS0JoM5fss6OeQJrUA="}],"unpackedSize":146080},"main":"js/index.js","name":"@cflorioluis/barcodereader","type":"module","types":"js/index.d.ts","exports":{".":{"types":"./js/index.d.ts","default":"./js/index.js"}},"gitHead":"03c081a5cb6dc0ddec0c304301c9ae446b3af06c","license":"MIT","scripts":{"build":"npm run build:wasm && npm run build:js","build:js":"tsc -p tsconfig.json","test:core":"cargo test -p barcode-core","build:wasm":"wasm-pack build wasm --target web --out-dir pkg && rm -f wasm/pkg/.gitignore","prepublishOnly":"npm run build"},"version":"0.2.1","_npmUser":{"name":"cflorioluis","email":"cflorioluis@gmail.com"},"keywords":["qr","barcode","scanner","wasm","rust","camera"],"_npmVersion":"12.0.2","description":"Dependency-free 1D/2D barcode & QR decoder. One Rust core, WASM for web (Angular/React/Vue/Electron/Capacitor), native FFI later.","directories":{},"maintainers":[{"name":"cflorioluis","email":"cflorioluis@gmail.com"}],"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/barcodereader_0.2.1_1790350904404_0.4320500862554377"}}},"time":{"created":"2026-07-13T17:41:51.408Z","modified":"2026-09-25T15:41:44.665Z","0.1.0":"2026-07-13T17:41:51.726Z","0.2.0":"2026-09-25T12:20:10.440Z","0.2.1":"2026-09-25T15:41:44.507Z"},"license":"MIT","keywords":["qr","barcode","scanner","wasm","rust","camera"],"description":"Dependency-free 1D/2D barcode & QR decoder. One Rust core, WASM for web (Angular/React/Vue/Electron/Capacitor), native FFI later.","maintainers":[{"name":"cflorioluis","email":"cflorioluis@gmail.com"}],"readme":"# BarCodeReader\n\nA dependency-free 1D/2D barcode &amp; QR decoder with **one core** that runs\neverywhere JavaScript runs — and, later, everywhere native FFI reaches.\n\n## The idea\n\nThe decoding logic is written **once** in pure Rust (`core/`). It knows nothing\nabout cameras, files or platforms: it takes a grayscale pixel buffer and returns\nthe decoded symbols. Every platform is a thin binding on top:\n\n```\ncore (Rust, pure, no I/O)\n  decode_luma(pixels, width, height) -> Vec<Symbol>\n        │\n        ├── wasm/   → wasm-pack → npm → Angular, React, Vue, Electron, Capacitor   ← we are here\n        ├── ffi/    → .so/.dll/.dylib (C ABI) → Flutter (dart:ffi), PHP (FFI), Python   (step 2)\n        └── uniffi  → Swift + Kotlin → native iOS / Android                              (step 3)\n```\n\nEach platform only supplies pixels its own way (getUserMedia on web,\nAVFoundation on iOS, CameraX on Android). The hard part — finder patterns,\nperspective sampling, Reed-Solomon, payload decoding — lives in the core and is\ntested once.\n\n## Layout\n\n| Path | What it is |\n|------|-----------|\n| `core/` | Pure-Rust decoder. Image handling, binarization, QR pipeline. |\n| `wasm/` | `wasm-bindgen` wrappers → npm package (via `wasm-pack`). |\n| `js/` | Framework-agnostic camera glue + high-level `BarcodeScanner`. |\n| `docs/` | Integration guides (Angular, React, Capacitor, WASM bundling). |\n| `demo/` | Runnable apps: React, Angular, Capacitor (+ `examples/web`). |\n| `examples/web/` | Minimal browser demo driving the camera, zero build. |\n| `ROADMAP.md` | Staged build plan and current status of each pipeline stage. |\n\n## Status\n\nQR decoding works end-to-end from camera/image pixels: binarization (adaptive +\nOtsu), finder detection, perspective-corrected sampling, format info,\nReed-Solomon, and payload decode (numeric / alphanumeric / byte / ECI). Verified\nagainst generated QR codes across versions 1–27, all EC levels, and a real\nphotographed thermal-receipt fixture.\n\n**Tilted codes (0.2.0):** a QR seen at an angle is mapped back to a square with\na full homography fitted from the finder-pattern corners (plus the alignment\npattern when present), so codes decode reliably up to ~45° of tilt — including\nversion-1 codes, which have no alignment pattern. See\n[CHANGELOG.md](CHANGELOG.md) for measurements and limits. 1D symbologies and native FFI bindings are next — see\n`ROADMAP.md`.\n\n**New here? Start with [docs/getting-started.md](docs/getting-started.md).**\n\n## Build (once the Rust toolchain is installed)\n\n```bash\n# 1. Toolchain (one-time)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\ncargo install wasm-pack\n\n# 2. Run core tests\ncargo test -p barcode-core\n\n# 3. Build the npm/WASM package\nwasm-pack build wasm --target web --out-dir pkg\n# → wasm/pkg/ is a ready-to-import ES module + .wasm\n```\n\nThen import from any framework:\n\n```ts\nimport { BarcodeScanner } from \"@cflorioluis/barcodereader\";\n\nconst scanner = new BarcodeScanner();\nawait scanner.start((r) => console.log(r.format, r.text)); // call from a click\n```\n\n## Platform notes\n\n- **iOS Safari**: HTTPS (or localhost) + a user gesture to start. `playsinline`\n  is set on the video element (required).\n- **Android Chrome / desktop**: works out of the box on HTTPS/localhost.\n- **Capacitor**: runs in the WebView using the same WASM path.\n- **Electron**: same WASM path (Chromium runtime).\n","readmeFilename":"README.md"}