Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gosuri/uilive
uilive is a go library for updating terminal output in realtime
https://github.com/gosuri/uilive
Last synced: about 13 hours ago
JSON representation
uilive is a go library for updating terminal output in realtime
- Host: GitHub
- URL: https://github.com/gosuri/uilive
- Owner: gosuri
- License: mit
- Created: 2015-11-16T06:13:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-22T11:29:29.000Z (over 1 year ago)
- Last Synced: 2024-12-04T20:11:52.086Z (8 days ago)
- Language: Go
- Homepage:
- Size: 324 KB
- Stars: 1,701
- Watchers: 17
- Forks: 87
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - uilive - Library for updating terminal output in real time. (Command Line / Advanced Console UIs)
- my-awesome - gosuri/uilive - 07 star:1.7k fork:0.1k uilive is a go library for updating terminal output in realtime (Go)
- fucking-awesome-go - uilive - Library for updating terminal output in real time. (Command Line / Advanced Console UIs)
- awesome-go - uilive - Library for updating terminal output in real time. (Command Line / Advanced Console UIs)
- awesome-list - uilive
- awesome-go - uilive - Library for updating terminal output in real time. Stars:`1.7K`. (Command Line / Advanced Console UIs)
- awesome-go - uilive - Library for updating terminal output in realtime. (Command Line / Advanced Console UIs)
- awesome-go - uilive - uilive is a go library for updating terminal output in realtime - ★ 689 (Command Line)
- awesome-go-extra - uilive - 11-16T06:13:10Z|2022-01-20T09:35:17Z| (Build Automation / Advanced Console UIs)
- awesome-go-with-stars - uilive - Library for updating terminal output in real time. (Command Line / Advanced Console UIs)
- awesome-go-cn - uilive
- awesome-go-plus - uilive - Library for updating terminal output in real time. ![stars](https://img.shields.io/badge/stars-1701-blue) (Command Line / Advanced Console UIs)
- awesome-go-plus - uilive - Library for updating terminal output in real time. ![stars](https://img.shields.io/badge/stars-1698-blue) (Command Line / Advanced Console UIs)
README
# uilive [![GoDoc](https://godoc.org/github.com/gosuri/uilive?status.svg)](https://godoc.org/github.com/gosuri/uilive) [![Build Status](https://travis-ci.org/gosuri/uilive.svg?branch=master)](https://travis-ci.org/gosuri/uilive)
uilive is a go library for updating terminal output in realtime. It provides a buffered [io.Writer](https://golang.org/pkg/io/#Writer) that is flushed at a timed interval. uilive powers [uiprogress](https://github.com/gosuri/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](example/main.go).
```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](doc/example.gif)
## Installation
```sh
$ go get -v github.com/gosuri/uilive
```