{"id":37362600,"url":"https://github.com/baao/ngx-scanner-detection","last_synced_at":"2026-01-16T04:47:48.536Z","repository":{"id":34905704,"uuid":"188726399","full_name":"baao/ngx-scanner-detection","owner":"baao","description":"Detects barcode scanning on document, validates it and emits the scanned barcode. For Angular 7 (should work with former versions too)","archived":false,"fork":false,"pushed_at":"2023-01-07T05:49:04.000Z","size":1392,"stargazers_count":5,"open_issues_count":32,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T23:43:50.462Z","etag":null,"topics":["angular","angular5","angular6","angular7","barcode","barcode-scanner","barcode-scanning"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"baao","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-05-26T20:03:32.000Z","updated_at":"2022-03-16T13:12:58.000Z","dependencies_parsed_at":"2023-01-15T10:09:43.147Z","dependency_job_id":null,"html_url":"https://github.com/baao/ngx-scanner-detection","commit_stats":null,"previous_names":["baao/scanner-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baao/ngx-scanner-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baao%2Fngx-scanner-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baao%2Fngx-scanner-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baao%2Fngx-scanner-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baao%2Fngx-scanner-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baao","download_url":"https://codeload.github.com/baao/ngx-scanner-detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baao%2Fngx-scanner-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular5","angular6","angular7","barcode","barcode-scanner","barcode-scanning"],"created_at":"2026-01-16T04:47:48.481Z","updated_at":"2026-01-16T04:47:48.531Z","avatar_url":"https://github.com/baao.png","language":"TypeScript","readme":"# NgxScannerDetection\n\nDetects barcode scanning on document, validates it and emits the scanned barcode.\nFor Angular 7+ (should work with former versions too)\n\n### Installation\n\n``npm install ngx-scanner-detection``\n\n\n### app.module\n\n``` \nimport {ScannerDetectionModule} from 'ngx-scanner-detection';\n```\n\nAnd add ``ScannerDetectionModule`` to imports\n\n\n### Config\n\n```\ninterface ScannerConfiguration {\n  minLength?: number; // 7\n  maxLength?: number; //  14\n  scannerStartsWith?: string; // '' - characters to trim before the code\n  scannerEndsWith?: string; // '' - characters to trim after the code\n  scanTimeout?: number; // 100 - timeout for detection in ms\n  replaceNotNumber?: boolean; // true - allowes numbers only [0-9], replace everything else\n  allowNotNumber?: boolean; // false  - allowes numbers only [0-9], replace everything else\n  ignoreOverElement?: string[]; // ['INPUT'] - array of tag names that should disable emit\n  barcodeType?: string; // ean13 - gtin[d] or ean[\\]\n}\n```\n\n### Usage\n\n```\n\u003cngx-sw-scanner-detection\n  (scan)=\"handle($event)\"\n  [config]=\"{scannerEndsWith: 'Enter'}\"\n\u003e\n  \u003cinput #input\u003e ### not needed, only for showing the code\n\u003c/ngx-sw-scanner-detection\u003e\n\n\u003cbutton (click)=\"simulateScanner()\"\u003eScanner Simulation\u003c/button\u003e\n```\n\n### Example Component\n\n```\n  @ViewChild('input') input: ElementRef;\n\n  handle(event: ScanDetected) {\n    console.log(event);\n    this.input.nativeElement.value = event.barcode;\n  }\n\n  // dummy\n  simulateScanner() {\n    const s = '1234567890123';\n    for (let i = 0; i \u003c s.length; i++) {\n      const e = new KeyboardEvent('keyup', {bubbles : true, cancelable : true, key : s[i], shiftKey : false});\n      setTimeout(() =\u003e document.dispatchEvent(e));\n    }\n    const xe = new KeyboardEvent('keyup', {bubbles : true, cancelable : true, key : 'Enter', shiftKey : false});\n    setTimeout(() =\u003e document.dispatchEvent(xe));\n  }\n```\n---\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.3.\n\n## Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n","funding_links":["https://github.com/sponsors/baao"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaao%2Fngx-scanner-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaao%2Fngx-scanner-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaao%2Fngx-scanner-detection/lists"}