Skip to content

๐ŸŒ€ Spinny is a tiny terminal spinner package for the Nim Programming Language.

License

Notifications You must be signed in to change notification settings

Mobilpadde/spinny

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spinny

GitHub version Maintenance

Spinny is a tiny terminal spinner package for Nim Programming Language. Spinny in Action

Getting Started

You can use Nimble to install the package by running:

nimble install spinny

Feel free to take the example code to test out the package!

Usage

Spinny is quite easy to use. You can set an already running Spinny's symbol, color, or even the text!

import spinny, colorize, os

var spinner1 = newSpinny("Loading file..".fgWhite, "dots")
spinner1.setSymbolColor(colorize.fgBlue)
spinner1.start()

# do some work here
for x in countup(5, 10):
  sleep(500)

spinner1.success("File was loaded successfully.")

var spinner2 = newSpinny("Downloading files..".fgBlue, "dots5")
spinner2.setSymbolColor(colorize.fgLightBlue)
spinner2.start()

# do some work here
for x in countup(5, 10):
  sleep(500)

spinner2.error("Sorry, something went wrong during downloading!")

Spinny uses the colorize library for terminal colors. For spinners to use, take a look at the spinners JSON file. (Credit goes to sindresorhus)

API Reference

The following procs are available on a Spinny object:

  • setSymbolColor*(spinny: Spinny, color: proc(x: string): string)
  • setSymbol*(spinny: Spinny, newSymbol: string)
  • setText*(spinny: Spinny, newSymbol: string)
  • start*(spinny: Spinny)
  • stop*(spinny: Spinny)
  • success*(spinny: Spinny, msg: string)
  • error*(spinny: Spinny, msg: string)

Contributing

All contributions are welcome. Feel free to make this project better. :)

Authors

  • Mark Molnar

License

  • MIT

About

๐ŸŒ€ Spinny is a tiny terminal spinner package for the Nim Programming Language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nim 100.0%