Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harmon25/node-usb-barcode-scanner
Package to help work with USB HID based barcode scanners in nodejs
https://github.com/harmon25/node-usb-barcode-scanner
Last synced: 3 days ago
JSON representation
Package to help work with USB HID based barcode scanners in nodejs
- Host: GitHub
- URL: https://github.com/harmon25/node-usb-barcode-scanner
- Owner: harmon25
- License: apache-2.0
- Created: 2015-09-19T15:39:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-10T20:49:40.000Z (over 6 years ago)
- Last Synced: 2024-11-08T07:42:38.543Z (7 days ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 58
- Watchers: 8
- Forks: 26
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-usb-barcode-scanner
Package to help work with USB HID based barcode scanners in nodejs on Linux and OSX.[*Does not work on Windows*](https://github.com/node-hid/node-hid#windows-notes)
## Usage
```javascript
var usbScanner = require('../usbscanner').usbScanner;
var getDevices = require('../usbscanner').getDevices;//get array of attached HID devices
var connectedHidDevices = getDevices()//print devices
console.log(connectedHidDevices)//initialize new usbScanner - takes optional parmeters vendorId and hidMap - check source for details
var scanner = new usbScanner();//scanner emits a data event once a barcode has been read and parsed
scanner.on("data", function(code){
console.log("recieved code : " + code);
});```
* Thanks [@hanshuebner](https://github.com/hanshuebner) for [node-hid](https://github.com/node-hid/node-hid)