{"id":26974374,"url":"https://github.com/ziacik/ws-paper","last_synced_at":"2025-04-03T10:35:52.478Z","repository":{"id":40272333,"uuid":"378614069","full_name":"ziacik/ws-paper","owner":"ziacik","description":"Waveshare e-Paper high level display library","archived":false,"fork":false,"pushed_at":"2023-03-06T04:29:51.000Z","size":472,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-18T04:24:58.887Z","etag":null,"topics":["e-paper","raspberry-pi","waveshare"],"latest_commit_sha":null,"homepage":"https://ziacik.github.io/ws-paper/","language":"TypeScript","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/ziacik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-06-20T10:10:01.000Z","updated_at":"2023-06-03T23:03:15.000Z","dependencies_parsed_at":"2023-02-06T16:31:09.244Z","dependency_job_id":null,"html_url":"https://github.com/ziacik/ws-paper","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziacik%2Fws-paper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziacik%2Fws-paper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziacik%2Fws-paper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziacik%2Fws-paper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziacik","download_url":"https://codeload.github.com/ziacik/ws-paper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246987474,"owners_count":20865072,"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":["e-paper","raspberry-pi","waveshare"],"created_at":"2025-04-03T10:35:51.963Z","updated_at":"2025-04-03T10:35:52.460Z","avatar_url":"https://github.com/ziacik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Waveshare Paper\n\nHigh-level javascript library and CLI for drawing on a Waveshare e-Paper using Raspberry PI GPIO.\n\nCurrently, only a single device support is implemented, [EPD 7.5inch HD (B)](\u003chttps://www.waveshare.com/wiki/7.5inch_HD_e-Paper_HAT_(B)\u003e).\n\nThe source is inspired by [original waveshare example code](https://github.com/waveshare/e-Paper/blob/04d4621789dd6832222e1c7be8f04f93f51df331/RaspberryPi_JetsonNano/c/examples/EPD_7in5b_HD_test.c).\n\nLibrary documentation is at [https://ziacik.github.io/ws-paper/](https://ziacik.github.io/ws-paper/).\n\n## Prerequisites\n\nBecause the library uses _SPI_ to write data to the device, _SPI_ access need to be enabled on Raspberry.\n\nTo do that, run\n\n`sudo raspi-config`\n\nThen select _Interface Options_, and enable _SPI_.\n\n## Usage as a library\n\nInstall `npm i ws-paper`.\n\nImport a specific implementation of `Device`, and a high-level class for drawing, `Drawer`.\n\nInitialize the device, draw whatever you need to, and don't forget to finalize the device at the end, even in case of error.\n\nExample:\n\n```typescript\nimport { Drawer, Paper75HDB } from \"ws-paper\";\n\nconst device = new Paper75HDB();\nconst drawer = new Drawer(device);\n\nconst svg = `\u003csvg width=\"${device.width}\" height=\"${device.height}\"\u003e\u003ctext font-size=\"50\" x=\"50%\" y=\"20%\" text-anchor=\"middle\"\u003eHello, world!\u003c/text\u003e\u003c/svg\u003e`;\n\ndevice.initialize();\ndrawer.drawSvg(svg).finally(() =\u003e device.finalize());\n```\n\n## Usage as a CLI\n\n**Please note**, the cli needs to be used **as root** because `rpio` needs access to `/dev/mem` which is not allowed for non-root users.\n\nInstall globally `npm i -g ws-paper`.\n\nRun `ws-paper --help` to get list of available commands.\n\nExample:\n\n`ws-paper draw \"\u003csvg viewBox='0 0 880 528'\u003e\u003ctext font-size='120' x='50%' y='50%' text-anchor='middle'\u003eHello, world\u003c/text\u003e\u003c/svg\u003e\"`\n\nThe svg can be piped to the `ws-paper` from file or internet:\n\n`curl https://upload.wikimedia.org/wikipedia/commons/a/ad/24_petal_lotus_circle.svg | ws-paper draw`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziacik%2Fws-paper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziacik%2Fws-paper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziacik%2Fws-paper/lists"}