Debian Codegraph @

README.md

raw
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
9 Raw ANSI sequence helpers
10
11 ## ANSI Writer
12
13 ```go
14 import "github.com/muesli/ansi"
15
16 w := ansi.Writer{Forward: os.Stdout}
17 w.Write([]byte("\x1b[31mHello, world!\x1b[0m"))
18 w.Close()
19 ```
20
21 ## Compressor
22
23 The ANSI compressor eliminates unnecessary/redundant ANSI sequences.
24
25 ```go
26 import "github.com/muesli/ansi/compressor"
27
28 w := compressor.Writer{Forward: os.Stdout}
29 w.Write([]byte("\x1b[31mHello, world!\x1b[0m"))
30 w.Close()
31 ```