Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/cli-spinners
Spinners for use in the terminal
https://github.com/sindresorhus/cli-spinners
Last synced: 5 days ago
JSON representation
Spinners for use in the terminal
- Host: GitHub
- URL: https://github.com/sindresorhus/cli-spinners
- Owner: sindresorhus
- License: mit
- Created: 2016-03-03T18:13:57.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-07T13:13:36.000Z (4 months ago)
- Last Synced: 2025-01-05T10:18:27.954Z (6 days ago)
- Language: JavaScript
- Size: 320 KB
- Stars: 2,458
- Watchers: 20
- Forks: 112
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome - cli-spinners - Spinners for use in the terminal (JavaScript)
- awesome-github-star - cli-spinners
- jimsghstars - sindresorhus/cli-spinners - Spinners for use in the terminal (JavaScript)
README
# cli-spinners
> 70+ spinners for use in the terminal
The list of spinners is just a [JSON file](spinners.json) and can be used wherever.
You probably want to use one of these spinners through the [`ora`](https://github.com/sindresorhus/ora) package.
## Install
```sh
npm install cli-spinners
```## Usage
```js
import cliSpinners from 'cli-spinners';console.log(cliSpinners.dots);
/*
{
interval: 80,
frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
}
*/
```## Preview
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).
## API
### cliSpinners
Each spinner comes with a recommended `interval` and an array of `frames`.
[See the spinners.](spinners.json)
### randomSpinner()
Get a random spinner.
```js
import {randomSpinner} from 'cli-spinners';console.log(randomSpinner());
/*
{
interval: 80,
frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
}
*/
```## Related
- [ora](https://github.com/sindresorhus/ora) - Elegant terminal spinner
- [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinners for Swift
- [py-spinners](https://github.com/ManrajGrover/py-spinners) - Python port
- [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust
- [go-spinners](https://github.com/gabe565/go-spinners) - Go port