You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

3 months ago
  1. # cli-spinners
  2. > 70+ spinners for use in the terminal
  3. <p align="center">
  4. <br>
  5. <img width="700" src="screenshot.svg">
  6. <br>
  7. <br>
  8. </p>
  9. The list of spinners is just a [JSON file](spinners.json) and can be used wherever.
  10. You probably want to use one of these spinners through the [`ora`](https://github.com/sindresorhus/ora) module.
  11. ## Install
  12. ```sh
  13. npm install cli-spinners
  14. ```
  15. ## Usage
  16. ```js
  17. const cliSpinners = require('cli-spinners');
  18. console.log(cliSpinners.dots);
  19. /*
  20. {
  21. interval: 80,
  22. frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
  23. }
  24. */
  25. ```
  26. ## Preview
  27. The header GIF is outdated. See all the [spinner at once](https://jsfiddle.net/sindresorhus/2eLtsbey/embedded/result/) or [one at the time](https://asciinema.org/a/95348?size=big).
  28. ## API
  29. Each spinner comes with a recommended `interval` and an array of `frames`.
  30. [See the spinners.](spinners.json)
  31. The `random` spinner will return a random spinner each time it's called.
  32. ## Related
  33. - [ora](https://github.com/sindresorhus/ora) - Elegant terminal spinner
  34. - [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinners for Swift
  35. - [py-spinners](https://github.com/ManrajGrover/py-spinners) - Python port
  36. - [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust
  37. - [go-spinners](https://github.com/gabe565/go-spinners) - Go port