{"id":26700605,"url":"https://github.com/neved4/center","last_synced_at":"2025-10-03T16:43:33.645Z","repository":{"id":284195236,"uuid":"954125927","full_name":"Neved4/center","owner":"Neved4","description":"🛠️ Centers text read from stdin!","archived":false,"fork":false,"pushed_at":"2025-03-24T16:36:36.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T17:28:54.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neved4.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,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T15:46:09.000Z","updated_at":"2025-03-24T16:36:41.000Z","dependencies_parsed_at":"2025-03-24T17:40:20.101Z","dependency_job_id":null,"html_url":"https://github.com/Neved4/center","commit_stats":null,"previous_names":["neved4/center"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fcenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fcenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fcenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fcenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neved4","download_url":"https://codeload.github.com/Neved4/center/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688543,"owners_count":21145763,"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-03-27T00:28:34.086Z","updated_at":"2025-10-03T16:43:33.587Z","avatar_url":"https://github.com/Neved4.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![C](https://img.shields.io/badge/ISO_C17-A8B9CC?logo=c\u0026logoColor=fff)][C17]\n[![IEEE](https://img.shields.io/badge/POSIX.1\u0026#8209;2024-00629B?logo=ieee\u0026logoColor=fff)][POSIX.1-2024]\n[![Homebrew](https://img.shields.io/badge/Homebrew-tap-2AAB47?logo=homebrew\u0026logoColor=959DA5\u0026labelColor=2B3137)](https://github.com/Neved4/homebrew-tap/blob/main/Formula/center.rb)\n\n# center - Centers text from stdin! 🛠️\n\n[`center`] reads input from `stdin`, calculates the width of each line\n(considering multibyte characters), and center-aligns the text within the\nterminal window. Fully supports UTF-8.\n\n###### Originally by [Lizzy Fleckenstein][LizzyFleckenstein03/center] 🤍\n\n\n### Highlights\n\n- **Terminal size detection**: Adjusts text to fit the terminal width.\n- **Multibyte support**: Properly handles UTF-8 Unicode characters.\n- **Text centering**: Prints each line centered within the terminal.\n- **Error handling**: Graceful handling of system call failures.\n\n## Getting Started\n\n### Prerequisites\n\nIf you are building [`center`], you'll need:\n\n- A C compiler that supports [C99] or later.\n\n### Installing\n\nIf you have [Homebrew] installed, just run:\n\n```sh\nbrew install Neved4/homebrew-tap/center\n```\n\n### Implementation\n\n[`center`] operates as follows:\n\n1. Opens `/dev/tty` to get the terminal width.\n2. Reads input line-by-line.\n3. Calculates character width (supporting multibyte characters).\n4. Prints each line centered in the terminal.\n\n### Examples\n\nBelow is an example of how the [`center`] command works in practice:\n\n```console\n$ echo 'Hello World!' | center\n                                  Hello World!\n```\n\n## Compatibility\n\nRuns on _**Linux**_, _**macOS**_ and _**\\*BSD**_ systems on [`x86_64`] and\n[`arm64`], and compiles with [`zig`], [`clang`], [`gcc`], [`tcc`] and any other\ncompiler that supports [C99] or later.\n\n## Standards\n\n[`center`] is compatible with [POSIX.1-2024][][^1] as well as the [C23][][^2] standard.\n\n## See Also\n\nFor further reference and related tools, check out the following:\n\n- [LizzyFleckenstein03/center]\n\n## License\n\n[`center`] is licensed under the terms of the [GPLv3 License].\n\nSee the [LICENSE](LICENSE) file for details.\n\n[`arm64`]: https://en.wikipedia.org/wiki/AArch64\n[`center`]: https://github.com/Neved4/center\n[`clang`]: https://clang.llvm.org/\n[`gcc`]: https://gcc.gnu.org/\n[`tcc`]: https://bellard.org/tcc/\n[`x86_64`]: https://en.wikipedia.org/wiki/X86-64\n[`zig`]: https://ziglang.org/\n[C99]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\n[C17]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf\n[C23]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf\n[GPLv3 License]: https://www.gnu.org/licenses/gpl-3.0.en.html\n[Homebrew]: https://brew.sh/\n[LizzyFleckenstein03/center]: https://github.com/LizzyFleckenstein03/center/blob/master/center.c\n[POSIX.1-2024]: https://pubs.opengroup.org/onlinepubs/9799919799/\n\n[^1]: _IEEE Std 1003.1-2024: Standard for Information Technology\n    — Portable Operating System Interface (POSIX®)_, \\\n    ISO/IEC DIS 9945. URL: https://pubs.opengroup.org/onlinepubs/9799919799/\n[^2]: _ISO/IEC 9899: Standard for Information Technology\n    — Programming languages — C_, ISO/IEC 9899:2023. \\\n    URL: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneved4%2Fcenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneved4%2Fcenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneved4%2Fcenter/lists"}