A NodeJS module to USB Card Reader
Open source with a Github repository
$ npm i node-usb-cardreader
const USBCardReader = require('node-usb-cardreader')
//Default options
const options = {
onRead: console.log, //function to be called
onError: console.log, //function to be called
onConnection: console.log, //function to be called
idVendor: 0, // Mandatory to connect
idProduct: 0, // Mandatory to connect
lowerCase: true
}
let reader = new USBCardReader({ idVendor: 1204, idProduct: 4623 });
console.log(reader.getDeviceList(true))
Dependecy |
---|
usb |
- getDeviceList - List all USB devices connecteds
- findDeviceByIds - Get an especific device using idVendor and idProduct
If you are on Windows you must install WinUSB driver Zadig This project use USB Library for Node USB
- Tests