{"id":18564682,"url":"https://github.com/0xc0d/go-fold","last_synced_at":"2025-05-15T18:34:32.594Z","repository":{"id":57624012,"uuid":"397866052","full_name":"0xc0d/go-fold","owner":"0xc0d","description":"A Go implementation of fold command (unix) around io.Reader","archived":false,"fork":false,"pushed_at":"2021-09-06T11:31:25.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-26T12:09:27.834Z","etag":null,"topics":["fold","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/0xc0d.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":"2021-08-19T08:07:59.000Z","updated_at":"2021-09-06T11:31:28.000Z","dependencies_parsed_at":"2022-08-26T22:11:03.161Z","dependency_job_id":null,"html_url":"https://github.com/0xc0d/go-fold","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0d%2Fgo-fold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0d%2Fgo-fold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0d%2Fgo-fold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0d%2Fgo-fold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xc0d","download_url":"https://codeload.github.com/0xc0d/go-fold/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239293948,"owners_count":19615043,"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":["fold","go"],"created_at":"2024-11-06T22:16:00.646Z","updated_at":"2025-02-17T13:14:17.614Z","avatar_url":"https://github.com/0xc0d.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fold\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/0xc0d/go-fold)](https://pkg.go.dev/github.com/0xc0d/go-fold?tab=doc)\n\nA Go implementation of fold command (unix) around io.Reader.\n\n# Why\nFolding a string is not a hassle but a folding a stream in io.Reader \ncould be a little bit challenging. The idea for this fold reader started \nwhen we have encountered with an issue in streaming data as an email\nmessage. According to RFC 822:\n\u003e Lines of characters in the body MUST be limited to 998 characters, \nand SHOULD be limited to 78 characters, excluding the CRLF.\n\n# Install\n```\ngo get github.com/0xc0d/go-fold\n```\n\n# Use\n```go\npackage main\n\nimport (\n  \"io\"\n  \"os\"\n  \"strings\"\n  \n  \"github.com/0xc0d/go-fold\"\n)\n\nfunc main() {\n  s := strings.Repeat(\"0\", 20)\n  r := strings.NewReader(s)\n  foldReader := fold.NewReader(r, 7)\n  \n  io.Copy(os.Stdout, foldReader)\n}\n\n// Output:\n// 0000000\n// 0000000\n// 000000\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xc0d%2Fgo-fold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xc0d%2Fgo-fold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xc0d%2Fgo-fold/lists"}