1.0.2 • Published 9 months ago

@comandeer/cli-spinner v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@comandeer/cli-spinner

Build Status codecov npm (scoped)

Super simple CLI spinner.

Installation

npm install @comandeer/cli-spinner --save

Usage

import Spinner from '@comandeer/cli-spinner';

const spinner = new Spinner( {
	label: 'Working…'
} );

await spinner.show();

//do something

await spinner.hide();

Configuration

You can configure the spinner by passing options via options object in the constructor:

const spinner = new Spinner( options );

The list of available options is presented below:

NameTypeDefault valueDescription
stdoutStreamprocess.stderrStream to which the spinner will be outputted.
labelstring''Additional text label that will be displayed next to the spinner.
spinnerArray<string>See src/defaultSpinner.jsAn array containing frames that will be used to animate the spinner.
intervalnumber80Indicates how often frames of the spinner should be changed.

Why should I use it instead of x?

The truth is: you probably shouldn't. This package was created because I couldn't stand the API of gauge and ora didn't work for me for some reason. As I have quite severe NIH syndrome, I decided to create my own, very naive implementation of a CLI spinner.

So if you look for a battle-tested solution and don't mind more convoluted API, use gauge. If you prefer a battle-tested solution but with really user-friendly API, use ora. If for some reason these solutions don't work for you, you probably still shouldn't use this package.

License

See LICENSE file for details.

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.3.0

2 years ago

0.2.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.1.0

3 years ago