https://github.com/erikh/colorwriter
a fork of text/tabwriter that handles escape codes
https://github.com/erikh/colorwriter
Last synced: about 1 year ago
JSON representation
a fork of text/tabwriter that handles escape codes
- Host: GitHub
- URL: https://github.com/erikh/colorwriter
- Owner: erikh
- License: bsd-3-clause
- Created: 2021-01-26T15:35:47.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-27T07:19:53.000Z (over 5 years ago)
- Last Synced: 2025-02-08T10:42:44.487Z (over 1 year ago)
- Language: Go
- Size: 24.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colorwriter: a tabwriter that is escape code tolerant
This is a fork of text/tabwriter that is escape code friendly, in that:
- Escape codes (particularly, color codes; more are planned) are not counted in the width calculation for each table
- Escape codes are still printed
When coupled with a library like [fatih/color](https://github.com/fatih/color) you can get some great results. Check out our [example](example). For a quick demo, run these commands (will pull the repository):
```bash
go get -d github.com/erikh/colorwriter
go run github.com/erikh/colorwriter/example
```
Which will print some diagnostics and show you how the two libraries differ in
effect.
## Author
- Almost all of this is taken from golang 1.15's frozen text/tabwriter package, and belongs to the Go authors and Google, Inc.
- Erik Hollensbe is responsible for the colorwriter additions and this repository.
## License
- BSD 3-Clause (Go License)