{"id":18553253,"url":"https://github.com/namshi/keyscannerjs","last_synced_at":"2025-04-09T22:32:18.916Z","repository":{"id":47512065,"uuid":"141239422","full_name":"namshi/keyscannerjs","owner":"namshi","description":"A library to detect automated keyboard events from external devices (such as a barcode scanner)","archived":false,"fork":false,"pushed_at":"2018-07-22T12:40:27.000Z","size":71,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T13:21:21.947Z","etag":null,"topics":["barcode-detection","barcode-scanner","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-17T06:07:30.000Z","updated_at":"2023-10-25T06:52:35.000Z","dependencies_parsed_at":"2022-09-09T12:11:00.871Z","dependency_job_id":null,"html_url":"https://github.com/namshi/keyscannerjs","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namshi%2Fkeyscannerjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namshi%2Fkeyscannerjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namshi%2Fkeyscannerjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namshi%2Fkeyscannerjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namshi","download_url":"https://codeload.github.com/namshi/keyscannerjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247886911,"owners_count":21012918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["barcode-detection","barcode-scanner","javascript"],"created_at":"2024-11-06T21:16:33.081Z","updated_at":"2025-04-09T22:32:17.782Z","avatar_url":"https://github.com/namshi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 width=\"100%\"  align=\"middle\"\u003eKeyScanner\u003c/h1\u003e\n\n\u003cimg src=\"https://cdn.rawgit.com/namshi/keyscannerjs/master/scanner.svg\" height=\"150\" width=\"100%\" align=\"middle\"/\u003e\n\n## Overview\nKeyScanner is a library that allows reading input events from a barcode machine or other similar devices (like a mobile device with a barcode scanner), and distinguish them from normal user keystrokes. \nAll barcode scanners can feed text into your application if you're focused into a text field however, KeyScanner does not require user focus in a text field, and provides a simple API to obtain the scanned text.\nWhen you connect a barcode machine to your computer and scan a code, KeyScanner intercepts those and makes it available to your application in an easy to use manner.\n\n## Quick Start Guide\n```\nnpm i keyscanner --save\n```\n\n```js\nimport keyscanner from 'keyscanner';\n\nconst keyScanHandle = new keyscanner(myFuncOnScan);\n\nconst myFuncOnScan = barcodeValue =\u003e {\n    console.log('The scan from your barcode machine', barcodeValue);\n    // Do what you like with the barcodeValue now !!!\n}\n```\n\n#### Ask keyscanner to Stop Listening to events when you no longer need it\n\n```js\nconst keyScanHandle = new keyscanner(myFuncOnScan);\nkeyScanHandle.stop();\n```\n\n#### Configuration Options (Optional)\n\n```js\n    const config = {\n        overall_percentage : 80,\n        key_stroke_speed_ms: 0.017,\n        minimum_no_chars: 5\n    }\n    const keyScanHandle = new keyscanner(myFuncOnScan, config);\n```\n| Property | Description|\n|:---- |:---- |\n| overall_percentage      | The Overall percentage 1 - 100, at which scanner input passes the speed threshold mentioned in key_stroke_speed_ms.(default 95, meaning 95% of the character input must be faster than the speed threshold mentioned in key_stroke_speed_ms)|\n| key_stroke_speed_ms     | The speed in milli-seconds the scanner sends alphabets it scans. (default: 0.017)|\n| minimum_no_chars | The minimum number of characters that a barcode should contain, inorder to get notified (default 4). Hence any inputs containing less than the value specified is ignored by keyscanner. |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamshi%2Fkeyscannerjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamshi%2Fkeyscannerjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamshi%2Fkeyscannerjs/lists"}