{"id":13393614,"url":"https://github.com/cheynewallace/tabby","last_synced_at":"2025-04-10T19:56:38.119Z","repository":{"id":45829129,"uuid":"162203238","full_name":"cheynewallace/tabby","owner":"cheynewallace","description":"A tiny library for super simple Golang tables","archived":false,"fork":false,"pushed_at":"2020-12-23T01:20:33.000Z","size":13,"stargazers_count":358,"open_issues_count":3,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T19:39:02.508Z","etag":null,"topics":[],"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/cheynewallace.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":"2018-12-17T23:35:39.000Z","updated_at":"2025-02-11T21:34:23.000Z","dependencies_parsed_at":"2022-09-02T06:10:50.452Z","dependency_job_id":null,"html_url":"https://github.com/cheynewallace/tabby","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheynewallace%2Ftabby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheynewallace%2Ftabby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheynewallace%2Ftabby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheynewallace%2Ftabby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheynewallace","download_url":"https://codeload.github.com/cheynewallace/tabby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248285608,"owners_count":21078322,"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-07-30T17:00:57.034Z","updated_at":"2025-04-10T19:56:38.094Z","avatar_url":"https://github.com/cheynewallace.png","language":"Go","funding_links":[],"categories":["Misc","Command Line","命令行","高级控制台UI","Go","Build Automation","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`"],"sub_categories":["Advanced Console UIs","高级控制台用户界面","标准 CLI"],"readme":"[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n# Tabby\n\nA tiny library for super simple Golang tables\n\n**Get Tabby**\n\n```go\ngo get github.com/cheynewallace/tabby\n```\n\n**Import Tabby**\n\n```go\nimport \"github.com/cheynewallace/tabby\"\n```\n\nTabby is a tiny (around 70 lines of code) efficient libary for writing extremely simple table based terminal output in Golang.\n\nMany table libraries out there are overly complicated and packed with features you don't need. If you simply want to write clean output to your terminal in table format with minimal effort, Tabby is for you.\n\nTypical examples\n\n- Writing simple tables with heading and tab spaced columns\n- Writing log lines to the terminal with evenly spaced columns\n\n## Example With Heading\n\n```go\nt := tabby.New()\nt.AddHeader(\"NAME\", \"TITLE\", \"DEPARTMENT\")\nt.AddLine(\"John Smith\", \"Developer\", \"Engineering\")\nt.Print()\n```\n\n**Output**\n\n```\nNAME        TITLE      DEPARTMENT\n----        -----      ----------\nJohn Smith  Developer  Engineering\n```\n\n## Example Without Heading\n\n```go\nt := tabby.New()\nt.AddLine(\"Info:\", \"WEB\", \"Success 200\")\nt.AddLine(\"Info:\", \"API\", \"Success 201\")\nt.AddLine(\"Error:\", \"DATABASE\", \"Connection Established\")\nt.Print()\n```\n\n**Output**\n\n```\nInfo:   WEB       Success 200\nInfo:   API       Success 201\nError:  DATABASE  Connection Established\n```\n\n## Example With Custom tabWriter\n\n```go\nw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)\nt := tabby.NewCustom(w)\n```\n\n## Full Example\n\n- Default writer (os.Stdout) example:\n\n```go\npackage main\n\nimport \"github.com/cheynewallace/tabby\"\n\nfunc main() {\n\tt := tabby.New()\n\tt.AddHeader(\"NAME\", \"TITLE\", \"DEPARTMENT\")\n\tt.AddLine(\"John Smith\", \"Developer\", \"Engineering\")\n\tt.Print()\n}\n```\n\n- File writer example:\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"text/tabwriter\"\n\n\t\"github.com/cheynewallace/tabby\"\n)\n\nfunc main() {\n\tfd, _ := os.OpenFile(\"test.txt\", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)\n\tdefer fd.Close()\n\n\tw := tabwriter.NewWriter(fd, 0, 0, 4, ' ', 0)\n\tt := tabby.NewCustom(w)\n\tt.AddHeader(\"NAME\", \"TITLE\", \"DEPARTMENT\")\n\tt.AddLine(\"John Smith\", \"Developer\", \"Engineering\")\n\tt.Print()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheynewallace%2Ftabby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheynewallace%2Ftabby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheynewallace%2Ftabby/lists"}