# cli-spinner

> A simple spinner

Latest version **0.2.10** (published 2019-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install cli-spinner
pnpm add cli-spinner
yarn add cli-spinner
bun add cli-spinner
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.10 |
| Published | 2019-03-01 |
| First published | 2013-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/cli-spinner) |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Unpacked size | 83.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 273 |
| Author | Pasquale Boemio |
| Maintainers | boemianrapsodi |
| Keywords | cli |

## Links

- npm: https://www.npmjs.com/package/cli-spinner
- Repository: https://github.com/helloIAmPau/node-spinner
- Homepage: https://github.com/helloIAmPau/node-spinner#readme
- Issues: https://github.com/helloIAmPau/node-spinner/issues
- npm.io page: https://npm.io/package/cli-spinner

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.2.10 (latest) — 2019-03-01
- 0.2.8 — 2018-02-16
- 0.2.7 — 2017-10-26
- 0.2.6 — 2017-02-04
- 0.2.5 — 2016-03-26
- 0.2.4 — 2016-02-04
- 0.2.3 — 2016-02-03
- 0.2.2 — 2016-01-17
- 0.2.1 — 2015-05-14
- 0.2.0 — 2015-01-04
- 0.1.6 — 2014-12-26
- 0.1.5 — 2013-12-15
- 0.1.4 — 2013-11-13
- 0.1.2 — 2013-11-13

## README

# node-spinner

A simple spinner for node cli.

[![NPM](https://nodei.co/npm/cli-spinner.png?downloads=true&downloadRank=true)](https://nodei.co/npm/cli-spinner/) [![NPM](https://nodei.co/npm-dl/cli-spinner.png?months=6&height=3)](https://nodei.co/npm/cli-spinner/)

---

## Installation

This package is available on [npm](http://npmjs.com) as `cli-spinner`.

``` sh
npm install cli-spinner
```

## Example usage

````javascript
var Spinner = require('cli-spinner').Spinner;

var spinner = new Spinner('processing.. %s');
spinner.setSpinnerString('|/-\\');
spinner.start();
````

## APIs

```
var obj = new Spinner('processing.. %s')

var obj = new Spinner({
    text: 'processing.. %s',
    stream: process.stderr,
    onTick: function(msg){
        this.clearLine(this.stream);
        this.stream.write(msg);
    }
})
```

Create a new spinner object. The advanced options can be used in any combination, none of them are required.


**`obj.start()`**

Starts the spinner.


**`obj.stop(clean)`**

Stops the spinner. Accepts a Boolean parameter to clean the console.


**`obj.isSpinning()`**

Returns true/false depending on whether the spinner is currently spinning.


**`obj.setSpinnerString(spinnerString)`**

Sets the spinner string. Accepts either a String or an Integer index to reference the [built-in spinners](#demo).


**`obj.setSpinnerDelay(spinnerDelay)`**

Sets the spinner animation speed.


**`obj.setSpinnerTitle(spinnerTitle)`**

Sets the spinner title. Use printf-style strings to position the spinner.


**`Spinner.setDefaultSpinnerString(spinnerString)`**

Sets the default spinner string for all newly created instances. Accepts either a String or an Integer index to reference the [built-in spinners](#demo).


**`Spinner.setDefaultSpinnerDelay(spinnerDelay)`**

Sets the default spinner delay for all newly created instances.

## Demo

To see a demonstration of the built-in spinners, point your console at the `example` folder and run:

````
node spinner.js
````

![preview](img/spinner.gif "Spinner")

---
_Source: https://npm.io/package/cli-spinner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
