# @joegesualdo/terminal-spinner-node

> Loading spinners in the terminal.

Latest version **0.0.3** (published 2016-07-12) · 0 weekly downloads

## Install

```sh
npm install @joegesualdo/terminal-spinner-node
pnpm add @joegesualdo/terminal-spinner-node
yarn add @joegesualdo/terminal-spinner-node
bun add @joegesualdo/terminal-spinner-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-07-12 |
| First published | 2016-07-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | joegesualdo |
| Keywords | spinner, loading, terminal |

## Links

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

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [hide-terminal-cursor](https://npm.io/package/hide-terminal-cursor.md) 0.0.1
- [show-terminal-cursor](https://npm.io/package/show-terminal-cursor.md) 0.0.2
- [@joegesualdo/indent-string](https://npm.io/package/@joegesualdo/indent-string.md) 0.0.6

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-07-12
- 0.0.2 — 2016-07-12
- 0.0.1 — 2016-07-12

## README

## terminal-spinner [![Build Status](https://travis-ci.org/joegesualdo/terminal-spinner-node.svg?branch=master)](https://travis-ci.org/joegesualdo/terminal-spinner-node)
> Loading spinners in the terminal.

## Install
```
$ npm install --save @joegesualdo/terminal-spinner-node
```

![demo](https://github.com/joegesualdo/terminal-spinner-node/raw/master/demo.gif)

## Usage
```javascript
import TerminalSpinner from '@joegesualdo/terminal-spinner-node';

let spinner = new TerminalSpinner({
  text: 'Loading',
  color: 'green',
})
spinner.on('done', () => {
  return '\n  One Down!'
})
spinner.begin()
```

## Test
```
$ npm test
```
## API
### `TerminalSpinner([options])`
> Creates an instance

#### Options
| Name | Type | Default |Description | 
|------|------|-------------|----------|
| text | `String` | ` ` | The loading text that will follow the spinner |
| color | `String` | `white` | Color of the spinner (`white`, `red`, `green`, `yellow`,`blue`, `magenta`, `cyan`, `gray`) |

```javascript
import TerminalSpinner from '@joegesualdo/terminal-spinner-node';

let spinner = new TerminalSpinner({
  text: 'Loading',
  color: 'green',
})
```

### `terminalSpinner.begin()`
> Starts the spinner

```javascript
import TerminalSpinner from '@joegesualdo/terminal-spinner-node';

let spinner = new TerminalSpinner()
spinner.begin()
```

### `terminalSpinner.stop()`
> Stops the spinner
```javascript
import TerminalSpinner from '@joegesualdo/terminal-spinner-node';

let spinner = new TerminalSpinner()
spinner.begin()
spinner.stop()
```

### `terminalSpinner.on(event, fn)`
> Intercepts the spinner a life-cycles

| Name | Type | Description |
|------|------|-------------|
| event | `String` | The lifecycle event. Supports: `done` |
| fn | `Function` | Function you want to run at the life-cycle |

```javascript
import TerminalSpinner from '@joegesualdo/terminal-spinner-node';

let spinner = new TerminalSpinner()

spinner.on('done', () => {
  return '\n  One Down!'
})

spinner.begin()
```
## Build
```
$ npm run build
```

## Related
- [example-package]() - Add description of the example package here.

## License
MIT © [undefined]()

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