rfid-stream
v1.0.1
Published
A simple package to outputs RFID from a keyboard-like card scanner devices, inspired from node-hid-stream and node-hid
Downloads
3
Readme
RFID-Stream
A simple parser of rfid from card readers that acts like a keyboard. Inspired from node-hid-stream and node-hid.
Install
Make sure node-hid can be installed before installing this.
npm i rfid-stream
How to use
const { RFIDStream } = require("rfid-stream");
const devices = RFIDStream.listDevices();
console.log(devices); // check the vendorId, productId, and path from here
const device = new RFIDStream({ vendorId: 6790, productId: 56577 });
device.on("data", (data) => {
console.log("data", data); // outpus "data 3890523184"
});
device.on("error", (err) => {
console.log("error", err);
});
Limitations
Refer to node-hid limitations to see what devices cannot be read. In general, It's easier to read from linux than other OS.