Minimal utility package to print user friendly messages to the console.
Can be used as an alternative to fmt.Println
while printing messages from your CLI tool.
- Minimal API
- Single dependency on charmbracelet/lipgloss
- Supports color schemes
- 10 inbuilt themes
- Support for custom themes
- Other utilities to print animated lines (like a progress bar)
Install from pkg.go.dev
go get github.com/sarkarshuvojit/pprinter
Simply import the package and intialise with a predefined theme & a custom theme of your own.
Then you can call the underlying methods.
package main
import (
"fmt"
"strings"
"github.com/sarkarshuvojit/pprinter/pprinter"
)
func main() {
pp := pprinter.WithTheme(pprinter.PastelTheme)
p.Info("Test")
p.Success("Test")
p.Warning("Test")
p.Error("Test")
}
Which would yeild the following output