vendor/github.com/muesli/ansi/README.md

31 lines · 1025 bytes

 1# ansi
 2
 3[![Latest Release](https://img.shields.io/github/release/muesli/ansi.svg)](https://github.com/muesli/ansi/releases)
 4[![Build Status](https://github.com/muesli/ansi/workflows/build/badge.svg)](https://github.com/muesli/ansi/actions)
 5[![Coverage Status](https://coveralls.io/repos/github/muesli/ansi/badge.svg?branch=master)](https://coveralls.io/github/muesli/ansi?branch=master)
 6[![Go ReportCard](https://goreportcard.com/badge/muesli/ansi)](https://goreportcard.com/report/muesli/ansi)
 7[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](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```