Socket
Socket
Sign inDemoInstall

cli-spinners

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cli-spinners

Spinners for use in the terminal


Version published
Maintainers
1
Install size
31.6 kB
Created

Package description

What is cli-spinners?

The cli-spinners package provides a collection of spinners for command-line interface (CLI) applications. These spinners can be used to indicate loading or processing status in a visually appealing way to the users of CLI applications.

What are cli-spinners's main functionalities?

Displaying Spinners

This feature allows you to display various spinner animations in the terminal. The code sample shows how to require the cli-spinners package and log one of the spinner types, in this case, 'dots'.

const cliSpinners = require('cli-spinners');
console.log(cliSpinners.dots);

Integrating with CLI Applications

This feature demonstrates how to integrate cli-spinners with another package like 'ora' to manage the spinner's lifecycle, including starting, stopping, and displaying success or failure messages.

const ora = require('ora');
const spinner = ora({
  text: 'Loading unicorns',
  spinner: cliSpinners.dots
}).start();

setTimeout(() => {
  spinner.succeed('Unicorns loaded');
}, 1000);

Other packages similar to cli-spinners

Readme

Source

cli-spinners

70+ spinners for use in the terminal




The list of spinners is just a JSON file and can be used wherever.

You probably want to use one of these spinners through the ora package.

Install

npm install cli-spinners

Usage

import cliSpinners from 'cli-spinners';

console.log(cliSpinners.dots);
/*
{
	interval: 80,
	frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
}
*/

Preview

The header GIF is outdated. See all the spinner at once or one at the time.

API

cliSpinners

Each spinner comes with a recommended interval and an array of frames.

See the spinners.

randomSpinner()

Get a random spinner.

import {randomSpinner} from 'cli-spinners';

console.log(randomSpinner());
/*
{
	interval: 80,
	frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
}
*/

Keywords

FAQs

Last updated on 30 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc