A very simple terminal spinner
0

Configure Feed

Select the types of activity you want to include in your feed.

Go 68.3%
Other 31.7%
42 1 5

Clone this repository

https://tangled.org/followtheprocess.codes/spin https://tangled.org/did:plc:3uqjv3gye2skz2s7syawzpwr
git@tangled.org:followtheprocess.codes/spin git@tangled.org:did:plc:3uqjv3gye2skz2s7syawzpwr

For self-hosted knots, clone URLs may differ based on your setup.



README.md

spin#

License Go Reference Go Report Card GitHub CI

A very simple terminal spinner

demo

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#

go get go.followtheprocess.codes/spin@latest

Quickstart#

package main

import (
    "os"
    "time"
    
    "go.followtheprocess.codes/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...

package main

import (
    "os"
    "time"
    
    "go.followtheprocess.codes/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.