{"id":27392218,"url":"https://github.com/samt/node-wiegand","last_synced_at":"2025-04-13T21:18:18.863Z","repository":{"id":26879293,"uuid":"111584957","full_name":"samt/node-wiegand","owner":"samt","description":"Wiegand Interface via GPIO in Node.js","archived":false,"fork":false,"pushed_at":"2022-04-08T23:47:10.000Z","size":25,"stargazers_count":10,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T21:18:15.897Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samt.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T18:14:33.000Z","updated_at":"2025-02-21T02:38:18.000Z","dependencies_parsed_at":"2022-07-27T08:52:38.542Z","dependency_job_id":null,"html_url":"https://github.com/samt/node-wiegand","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/samt%2Fnode-wiegand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samt%2Fnode-wiegand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samt%2Fnode-wiegand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samt%2Fnode-wiegand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samt","download_url":"https://codeload.github.com/samt/node-wiegand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782256,"owners_count":21160717,"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":"2025-04-13T21:18:18.341Z","updated_at":"2025-04-13T21:18:18.847Z","avatar_url":"https://github.com/samt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wiegand\n\nDecoder for [wiegand](https://en.wikipedia.org/wiki/Wiegand_interface) readers on GPIO.\nCurrently works on linux only, but can be tested on other platforms.\n\n## requirements\n\n* Linux with GPIO\n* node-gyp\n\n## installation\n\n```bash\n$ npm install --save wiegand\n```\n\n## running\n\nMake sure you export your GPIO pins according to the [epoll docs](https://github.com/fivdi/epoll/blob/master/README.md):\n\n```bash\n#!/bin/sh\necho 17 \u003e /sys/class/gpio/export\necho in \u003e /sys/class/gpio/gpio17/direction\necho both \u003e /sys/class/gpio/gpio17/edge\n```\n\n**Note**: If you are using the GPIO command to export, it does not automatically set the edge for you. You must do it separately:\n\n```bash\n$ gpio export 17 in\n$ echo both \u003e /sys/class/gpio/gpio17/edge\n```\n\n## usage\n\n```js\nconst wiegand = require('wiegand');\n\nconst w = wiegand();\n\nw.begin({ d0: 17, d1: 18});\n\nw.on('data', (data) =\u003e {\n    console.log('Got', data.length, 'bits from wiegand with data:', data);\n});\n\nw.on('keypad', (num) =\u003e {\n    console.log('Got', num, 'from the reader\\'s keypad');\n});\n\nw.on('reader', (id) =\u003e {\n    console.log('Got', id, 'from RFID reader');\n});\n\n```\n\n## api\n\n### class: Wiegand\n\ninherits EventEmitter\n\n#### method: begin([options], [callback])\n\ndefault options:\n```js\n{\n    // RaspberryPI default\n    d0: 17,\n    d1: 18,\n}\n```\n\n`callback` will fire on the `ready` event or if an error happens during the process. Errors will be emited on the `error` event.\n\n#### method: stop([callback])\n\nstop polling for changes to GPIO. Will callback when done and emit a `stop` event.\n\n#### event: 'ready'\n\n#### event: 'data'\n\n#### event: 'error'\n\n#### event: 'reader'\n\n#### event: 'keypad'\n\n#### event: 'stop'\n\n## license\n\n[The MIT License](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamt%2Fnode-wiegand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamt%2Fnode-wiegand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamt%2Fnode-wiegand/lists"}