{"analyzedAt":"2022-07-07T19:02:59.445Z","collected":{"metadata":{"name":"ngx-scanner-detection","scope":"unscoped","version":"0.0.7","description":"Detects barcode scanning on document, validates it and emits the scanned barcode. For Angular 7+ (should work with former versions too)","date":"2019-05-27T07:07:15.722Z","author":{"name":"Michael"},"publisher":{"username":"baao","email":"michael@ospackages.net"},"maintainers":[{"username":"baao","email":"michael@ospackages.net"}],"repository":{"type":"git","url":"git+https://github.com/baao/scanner-detection.git"},"links":{"npm":"https://www.npmjs.com/package/ngx-scanner-detection"},"license":"MIT","dependencies":{"tslib":"^1.9.0"},"peerDependencies":{"@angular/common":"^7.2.0","@angular/core":"^7.2.0"},"releases":[{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2020-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1}],"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<ngx-sw-scanner-detection\n  (scan)=\"handle($event)\"\n  [config]=\"{scannerEndsWith: 'Enter'}\"\n>\n  <input #input> ### not needed, only for showing the code\n</ngx-sw-scanner-detection>\n\n<button (click)=\"simulateScanner()\">Scanner Simulation</button>\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 < s.length; i++) {\n      const e = new KeyboardEvent('keyup', {bubbles : true, cancelable : true, key : s[i], shiftKey : false});\n      setTimeout(() => document.dispatchEvent(e));\n    }\n    const xe = new KeyboardEvent('keyup', {bubbles : true, cancelable : true, key : 'Enter', shiftKey : false});\n    setTimeout(() => 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)."},"npm":{"downloads":[{"from":"2022-07-06T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":11},{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":48},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":255},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":559},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1045},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1888}],"starsCount":0},"github":{"starsCount":5,"forksCount":3,"subscribersCount":2,"issues":{"count":35,"openCount":24,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":1,"2624400":2,"7873200":2,"23619600":11,"70858800":16,"212576400":3},"isDisabled":false},"contributors":[{"username":"baao","commitsCount":1}],"commits":[{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":2908,"testsSize":2029},"linters":["tslint","editorconfig"],"outdatedDependencies":{"tslib":{"required":"^1.9.0","stable":"2.4.0","latest":"2.4.0"}}}},"evaluation":{"quality":{"carefulness":0.42,"tests":0.3,"health":0.75,"branding":0},"popularity":{"communityInterest":11,"downloadsCount":186.33333333333334,"downloadsAcceleration":0.9900875190258751,"dependentsCount":0},"maintenance":{"releasesFrequency":0.28664383561643836,"commitsFrequency":0,"openIssues":0.3142857142857143,"issuesDistribution":0}},"score":{"final":0.38238011579586584,"detail":{"quality":0.671683079680456,"popularity":0.048048392403290036,"maintenance":0.4687378701445072}}}