uilive

uilive 是一个用于实时更新终端输出的 go 库。「uilive is a go library for updating terminal output in realtime」

  • Owner: gosuri/uilive
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

uilive GoDoc Build Status

uilive is a go library for updating terminal output in realtime. It provides a buffered io.Writer that is flushed at a timed interval. uilive powers uiprogress.

Usage Example

Calling uilive.New() will create a new writer. To start rendering, simply call writer.Start() and update the ui by writing to the writer. Full source for the below example is in example/main.go.

writer := uilive.New()
// start listening for updates and render
writer.Start()

for i := 0; i <= 100; i++ {
  fmt.Fprintf(writer, "Downloading.. (%d/%d) GB\n", i, 100)
  time.Sleep(time.Millisecond * 5)
}

fmt.Fprintln(writer, "Finished: Downloaded 100GB")
writer.Stop() // flush and stop rendering

The above will render

example

Installation

$ go get -v github.com/gosuri/uilive

Main metrics

Overview
Name With Ownergosuri/uilive
Primary LanguageGo
Program languageGo (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2015-11-16 06:13:10
Pushed At2023-07-22 11:29:29
Last Commit At2020-01-03 09:54:03
Release Count4
Last Release Namev0.0.4 (Posted on )
First Release Namev0.0.1 (Posted on )
用户参与
Stargazers Count1.7k
Watchers Count16
Fork Count89
Commits Count42
Has Issues Enabled
Issues Count19
Issue Open Count8
Pull Requests Count11
Pull Requests Open Count4
Pull Requests Close Count9
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private