{"id":17086598,"url":"https://github.com/arl/zt","last_synced_at":"2025-03-23T14:41:35.610Z","repository":{"id":42484293,"uuid":"477088949","full_name":"arl/zt","owner":"arl","description":"zt (zip-transparent) the transparent io.Reader for compressed data","archived":false,"fork":false,"pushed_at":"2022-04-05T12:23:39.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T20:44:39.363Z","etag":null,"topics":["go","golang","reader","zip"],"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/arl.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":"2022-04-02T15:07:07.000Z","updated_at":"2022-04-03T17:53:35.000Z","dependencies_parsed_at":"2022-09-17T11:11:17.795Z","dependency_job_id":null,"html_url":"https://github.com/arl/zt","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/arl%2Fzt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fzt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fzt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fzt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arl","download_url":"https://codeload.github.com/arl/zt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245119575,"owners_count":20563762,"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":["go","golang","reader","zip"],"created_at":"2024-10-14T13:29:02.154Z","updated_at":"2025-03-23T14:41:35.572Z","avatar_url":"https://github.com/arl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *zt*: the transparent `io.Reader` for compressed data\n\nPackage *zt* provides a type implementing the `io.ReadCloser` interface,\nthat transparently uncompresses a stream of compressed bytes. *zt* detects\nthe compression algorithm from the stream header, creates that appropriate\ndecompressor. In case the incoming data is not compressed, or if the compression\nalgorithm is unknown or unsupported, bytes are simply forwarded as-is.\n\nSupported compression algorithms are:\n  - [Zstandard](https://github.com/facebook/zstd)\n  - [Gzip](https://www.gzip.org/)\n  - [Bzip2](https://en.wikipedia.org/wiki/Bzip2)\n  - [zlib](https://www.zlib.net/)\n\n#### Example, a transparent decompressor.\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/arl/zt\"\n)\n\nfunc main() {\n\tr, err := zt.NewReader(os.Stdin)\n\tif err != nil { /* handle error */ }\n\tdefer r.Close()\n\n\t_, err = io.Copy(os.Stdout, r)\n\tif err != nil { /* handle error */ }\n}\n```\n\n```sh\ngo run main.go \u003c /some/file.gz  # decompress gzip-compressed file to stdout\ngo run main.go \u003c /some/file.zst # decompress zstandard-compressed file to stdout\ngo run main.go \u003c /some/file.bz2 # decompress bzip2-compressed file to stdout\ngo run main.go \u003c /some/file.zz  # decompress zlib-compressed file to stdout\ngo run main.go \u003c /some/file     # print non-compressed file to stdout\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farl%2Fzt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farl%2Fzt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farl%2Fzt/lists"}