https://github.com/followtheprocess/spin
A simple terminal spinner
https://github.com/followtheprocess/spin
Last synced: 2 months ago
JSON representation
A simple terminal spinner
- Host: GitHub
- URL: https://github.com/followtheprocess/spin
- Owner: FollowTheProcess
- License: mit
- Created: 2025-04-10T15:54:35.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-04-15T16:03:25.000Z (2 months ago)
- Last Synced: 2025-04-15T17:22:48.669Z (2 months ago)
- Language: Go
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spin
[](https://github.com/FollowTheProcess/spin)
[](https://pkg.go.dev/github.com/FollowTheProcess/spin)
[](https://goreportcard.com/report/github.com/FollowTheProcess/spin)
[](https://github.com/FollowTheProcess/spin)
[](https://github.com/FollowTheProcess/spin/actions?query=workflow%3ACI)A very simple terminal spinner
![]()
## Project Description
I needed a very simple, minimal overhead, nice looking terminal spinner that didn't bring in a shed load of dependencies. So here it is!
It has a few nicities:
- Auto terminal detection and colouring via [hue]
- Customisable colours
- Custom progress message
- Simple and convenient API## Installation
```shell
go get github.com/FollowTheProcess/spin@latest
```## Quickstart
```go
package mainimport (
"os"
"time"
"github.com/FollowTheProcess/spin"
)func main() {
spinner := spin.New(os.Stdout, "Digesting")spinner.Start()
defer spinner.Stop()time.Sleep(2 * time.Second)
}
```You can also wrap a function in a spinner...
```go
package mainimport (
"os"
"time"
"github.com/FollowTheProcess/spin"
)func main() {
spinner := spin.New(os.Stdout, "Digesting")// This is equivalent to the example above, Do will handle
// starting and stopping the spinner for you
spinner.Do(func() {
time.Sleep(2 * time.Second)
})
}
```### Credits
This package was created with [copier] and the [FollowTheProcess/go_copier] project template.
[copier]: https://copier.readthedocs.io/en/stable/
[FollowTheProcess/go_copier]: https://github.com/FollowTheProcess/go_copier
[hue]: https://github.com/FollowTheProcess/hue