# uiprogress **Repository Path**: leastedu/uiprogress ## Basic Information - **Project Name**: uiprogress - **Description**: uiprogress是用于实时更新终端输出的go库 - **Primary Language**: Go - **License**: MIT - **Default Branch**: master - **Homepage**: https://gitee.com/shirdonl/uiprogress.git - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2019-12-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # uiprogress uiprogress 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. uiprogress powers [uiprogress](https://gitee.com/shirdonl/uiprogress). ## Usage Example Calling `uiprogress.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 := uiprogress.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 gitee.com/shirdonl/uiprogress ```