{"id":20661498,"url":"https://github.com/deepsyx/pigpio-mock","last_synced_at":"2025-04-19T15:23:48.145Z","repository":{"id":48000314,"uuid":"97715874","full_name":"deepsyx/pigpio-mock","owner":"deepsyx","description":"Package used for locally developing node apps with pigpio.","archived":false,"fork":false,"pushed_at":"2022-12-06T17:46:12.000Z","size":62,"stargazers_count":20,"open_issues_count":12,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T09:22:13.666Z","etag":null,"topics":["hardware","nodejs","raspberry-pi"],"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/deepsyx.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":"2017-07-19T12:53:53.000Z","updated_at":"2023-05-07T01:02:52.000Z","dependencies_parsed_at":"2023-01-23T11:31:27.664Z","dependency_job_id":null,"html_url":"https://github.com/deepsyx/pigpio-mock","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/deepsyx%2Fpigpio-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsyx%2Fpigpio-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsyx%2Fpigpio-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsyx%2Fpigpio-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepsyx","download_url":"https://codeload.github.com/deepsyx/pigpio-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249725508,"owners_count":21316209,"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":["hardware","nodejs","raspberry-pi"],"created_at":"2024-11-16T19:09:52.365Z","updated_at":"2025-04-19T15:23:48.128Z","avatar_url":"https://github.com/deepsyx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pigpio-mock\n\n*Article: https://viktorkirilov.me/post/mocking-raspberry-gpios/*\n\nA mock library used for raspberry pi development on your local machine. It copies all method from https://github.com/fivdi/pigpio and logs information to the console, instead of controlling the Raspberry's GPIO pins.\n\n[![Build Status](https://travis-ci.org/deepsyx/pigpio-mock.svg?branch=master)](https://travis-ci.org/deepsyx/pigpio-mock) [![Coverage Status](https://coveralls.io/repos/github/deepsyx/pigpio-mock/badge.svg?branch=master)](https://coveralls.io/github/deepsyx/pigpio-mock?branch=master)\n\n# Example\nYou can also check `examples` folder.\n\n    const Gpio = require(\"pigpio-mock\").Gpio;\n    const led = new Gpio(13, { mode: Gpio.OUTPUT });\n    let dutyCycle = 0;\n    \n    setInterval(function() {\n    \tled.pwmWrite(dutyCycle);\n    \n    \tdutyCycle += 50;\n    \tif (dutyCycle \u003e 255) {\n    \t\tdutyCycle = 0;\n    \t}\n    }, 500);\n    \nshould output:\n\n    [GPIO 13 / constructor] Initializing...\n    [GPIO 13 / constructor] Setting mode = 1\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 0\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 50\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 100\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 150\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 200\n    [GPIO 13 / pwmWrite-analogWrite] Setting dutyCycle = 250\n\n# Installation\nIt is as simple as:\n\n    yarn add pigpio-mock\n    \nand you can use it in your code as:\n\n    const pigpio = process.env.NODE_ENV !== \"production\" ? \n        require(\"pigpio-mock\") : \n        require(\"pigpio\");\n    \n# Implemented classes:\n- [x] Gpio\n- [ ] GpioBank\n- [ ] Notifier\n\n# Contribution\nAll kind of contribution will be greatly appreciated. \n\n#### Pull requests\n* We're using https://github.com/enhancv/prettier for automatic code formating\n* Please provide tests. We're aiming for 100% code coverage\n\n#### Running tests\n\n    yarn test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsyx%2Fpigpio-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepsyx%2Fpigpio-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsyx%2Fpigpio-mock/lists"}