{"id":15393852,"url":"https://github.com/mitchellh/go-wordwrap","last_synced_at":"2025-05-16T14:09:38.053Z","repository":{"id":22088292,"uuid":"25417964","full_name":"mitchellh/go-wordwrap","owner":"mitchellh","description":"A Go (golang) library for wrapping words in a string. ","archived":false,"fork":false,"pushed_at":"2020-09-25T19:49:20.000Z","size":11,"stargazers_count":116,"open_issues_count":0,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T11:09:36.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mitchellh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-19T04:38:47.000Z","updated_at":"2025-03-09T17:04:13.000Z","dependencies_parsed_at":"2022-08-05T15:18:01.793Z","dependency_job_id":null,"html_url":"https://github.com/mitchellh/go-wordwrap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-wordwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-wordwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-wordwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-wordwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/go-wordwrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248368370,"owners_count":21092346,"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":"2024-10-01T15:20:31.845Z","updated_at":"2025-04-12T11:48:52.048Z","avatar_url":"https://github.com/mitchellh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-wordwrap\n\n`go-wordwrap` (Golang package: `wordwrap`) is a package for Go that\nautomatically wraps words into multiple lines. The primary use case for this\nis in formatting CLI output, but of course word wrapping is a generally useful\nthing to do.\n\n## Installation and Usage\n\nInstall using `go get github.com/mitchellh/go-wordwrap`.\n\nFull documentation is available at\nhttp://godoc.org/github.com/mitchellh/go-wordwrap\n\nBelow is an example of its usage ignoring errors:\n\n```go\nwrapped := wordwrap.WrapString(\"foo bar baz\", 3)\nfmt.Println(wrapped)\n```\n\nWould output:\n\n```\nfoo\nbar\nbaz\n```\n\n## Word Wrap Algorithm\n\nThis library doesn't use any clever algorithm for word wrapping. The wrapping\nis actually very naive: whenever there is whitespace or an explicit linebreak.\nThe goal of this library is for word wrapping CLI output, so the input is\ntypically pretty well controlled human language. Because of this, the naive\napproach typically works just fine.\n\nIn the future, we'd like to make the algorithm more advanced. We would do\nso without breaking the API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-wordwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fgo-wordwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-wordwrap/lists"}