Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.36 KB

README.md

File metadata and controls

62 lines (40 loc) · 1.36 KB

pprinter

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.

Features

  • 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)

Installation

Install from pkg.go.dev

go get github.com/sarkarshuvojit/pprinter

Usage/Examples

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

asciicast

Other Examples

Themes Example

asciicast

Animated Text Example

asciicast