vendor/github.com/muesli/ansi/README.md
31 lines · 1025 bytes
1# ansi
2
3[](https://github.com/muesli/ansi/releases)
4[](https://github.com/muesli/ansi/actions)
5[](https://coveralls.io/github/muesli/ansi?branch=master)
6[](https://goreportcard.com/report/muesli/ansi)
7[](https://pkg.go.dev/github.com/muesli/ansi)
8
9Raw ANSI sequence helpers
10
11## ANSI Writer
12
13```go
14import "github.com/muesli/ansi"
15
16w := ansi.Writer{Forward: os.Stdout}
17w.Write([]byte("\x1b[31mHello, world!\x1b[0m"))
18w.Close()
19```
20
21## Compressor
22
23The ANSI compressor eliminates unnecessary/redundant ANSI sequences.
24
25```go
26import "github.com/muesli/ansi/compressor"
27
28w := compressor.Writer{Forward: os.Stdout}
29w.Write([]byte("\x1b[31mHello, world!\x1b[0m"))
30w.Close()
31```