unescape

package module
v0.0.0-...-75f3a9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 3 Imported by: 0

README

unescape

This is an utility library for remove ANSI sequence from text. It is created for helping processing ANSI text produced in CI jobs.

It is inspired by muesli/ansi

Unescape Writer

import "github.com/alexjx/unescape"

w := unescape.Unescaper{Forward: os.Stdout}
w.Write([]byte("\x1b[31mHello, world!\x1b[0m"))

Documentation

Index

Constants

View Source
const Marker = '\x1B'

Variables

This section is empty.

Functions

This section is empty.

Types

type Unescaper

type Unescaper struct {
	Forward io.Writer
	// contains filtered or unexported fields
}

Unescaper is used to remove ANSI escape sequences from a stream of bytes.

func (*Unescaper) Write

func (w *Unescaper) Write(b []byte) (int, error)

Write implements io.Writer, it consumes the bytes and removes ANSI escape

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL