jimschubert / stripansi

Strip ansi escape codes, ala chalk/strip-ansi

Home Page:https://pkg.go.dev/github.com/jimschubert/stripansi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stripansi

This is a port of Sindre Sorhus's excellent chalk/strip-ansi to Go.

Install

$ go get -u github.com/jimschubert/stripansi

Usage

import (
	"fmt"
	"github.com/jimschubert/stripansi"
)

func main() {
	result := stripansi.String("\x1b[30mfoo\x1b[0m \x1b[30mbar\x1b[0m \x1b[30mbaz\x1b[0m")
	fmt.Println(result)
}

License

This is licensed under MIT.

About

Strip ansi escape codes, ala chalk/strip-ansi

https://pkg.go.dev/github.com/jimschubert/stripansi

License:MIT License


Languages

Language:Go 100.0%