{"id":23127635,"url":"https://github.com/hlfshell/serial-rfid-reader","last_synced_at":"2025-10-08T07:22:40.967Z","repository":{"id":34347029,"uuid":"38268210","full_name":"hlfshell/serial-rfid-reader","owner":"hlfshell","description":null,"archived":false,"fork":false,"pushed_at":"2015-08-21T14:02:01.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T17:14:44.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hlfshell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T19:59:27.000Z","updated_at":"2025-01-01T20:34:38.000Z","dependencies_parsed_at":"2022-09-14T03:50:23.680Z","dependency_job_id":null,"html_url":"https://github.com/hlfshell/serial-rfid-reader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fserial-rfid-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fserial-rfid-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fserial-rfid-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fserial-rfid-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlfshell","download_url":"https://codeload.github.com/hlfshell/serial-rfid-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128739,"owners_count":20888234,"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":[],"created_at":"2024-12-17T09:14:20.916Z","updated_at":"2025-10-08T07:22:35.928Z","avatar_url":"https://github.com/hlfshell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serial-rfid-reader\n\nThis library is for use for simple serial output RFID readers. It was originally created for the [Innovations RFID reader kit found at Sparkfun](https://www.sparkfun.com/products/13198). It should work for any RFID reader that dumps its output to a serial port that node can read.\n\n## Install\n```\nnpm install serial-rfid-reader\n```\n\n## Example use\n```\nvar RFIDReader = require('serial-rfid-reader');\nvar rfid = new RFIDReader('/dev/tty0', 9600);\n\nrfid.on(\"read\", function(read){\n\n  console.log(\"RFID reader has read the following: \", read);\n  \n}).listen(function(err){\n  console.log(\"RFID Reader is now listening!\");\n})\n```\n\n### Constructor\n\nThe constructor accepts two arguments.\n* port - A string representing the COM port to listen to. /dev/tty0 or COM4 are examples.\n* options\n  * If it is a number, it is assumed that this is the baud rate.\n  * If it is an object, it will be passed to node-serialport as options. Baudrate must be included.\n  \n### listen(cb)\nThis will open the serial port and start listening for reads. Once open, it will call the cb and the \"open\" event, whichever you've defined (if any).\n\n### close\nThis closes the serial port.\n\n### Events / functions\n\nThere are three events you can subscribe to.\n* serial - function(input, cb) - By default, this function will trim any non alphanumeric characters and spaces. This receives the raw input from the serial port. The callback function cb is function(err, parsedRead);\n* read - function(read) - This is called with the parsedRead returned from serial port if err is null.\n* open - function() - This is called when the serial port successfully opens.\n\n## node-serialport\n\nThis module makes use of node-serialport. This is a massive pain to compile on windows machines, so I suggest mozying on over to [their github page](https://github.com/voodootikigod/node-serialport). They have several excellent explanations there and on their wiki page that will help the install process.\n\n## node-webkit\nBuilding node-serialport for NW is a pain on windows- moreso when its a sub-module. [I wrote a helpful gist specifically for node-serialport](https://gist.github.com/hlfshell/3526882d232f7eee214e), but can act as a helpful guide for building serial-rfid-reader for packaged NW apps.\n\n[Here's an example of what I built with this module](https://blog.fusiondigital.io/office-wide-rfid-powered-nerf-war-274813506796).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlfshell%2Fserial-rfid-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlfshell%2Fserial-rfid-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlfshell%2Fserial-rfid-reader/lists"}