# working-bar

> Displays a bar while node is working

Latest version **1.7.3** (published 2019-04-24) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install working-bar
pnpm add working-bar
yarn add working-bar
bun add working-bar
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.7.3 |
| Published | 2019-04-24 |
| First published | 2017-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jay Deaton |
| Maintainers | jayrdeaton |

## Links

- npm: https://www.npmjs.com/package/working-bar
- Repository: https://github.com/jayrdeaton/workingBar
- Homepage: https://github.com/jayrdeaton/workingBar#readme
- Issues: https://github.com/jayrdeaton/workingBar/issues
- npm.io page: https://npm.io/package/working-bar

## Recent versions

- 1.7.3 (latest) — 2019-04-24
- 1.7.2 — 2018-02-04
- 1.7.1 — 2018-02-03
- 1.7.0 — 2018-02-03
- 1.5.2 — 2018-01-29
- 1.5.1 — 2018-01-29
- 1.5.0 — 2018-01-29
- 1.4.4 — 2018-01-29
- 1.4.3 — 2018-01-21
- 1.4.2 — 2018-01-21
- 1.4.1 — 2018-01-21
- 1.4.0 — 2018-01-21
- 1.3.4 — 2018-01-21
- 1.3.3 — 2018-01-21
- 1.3.2 — 2018-01-19
- … 8 more at https://npm.io/package/working-bar/versions

## README

# Working-Bar

A simple plugin to show some feedback while running processes in the command line

## Getting Started

These instructions will show you how to quickly get working-bar setup and displaying in your command line applications

### Installing

Add this package to your project

```
npm install --save working-bar
```

### Using

Instantiate object

```
let WorkingBar = require('working-bar');
let workingBar = new WorkingBar();
```

Configure object

```
workingBar.front = 'Working: [';
workingBar.back = '] Bar';
workingBar.character = '-----';
workingBar.length = 80;
```

Start process

```
workingBar.start();
```

Print a message without stopping display

```
workingBar.message('Hey there');
```

Even change attributes while working

```
workingBar.front = 'New Front: [';
workingBar.back = '] New Back';
```

Play around with different configurations

```
workingBar.before = '-';
workingBar.character = '-';
<!-- Or -->
workingBar.empty = '|';
workingBar.character = '----';
```
Also works with colored strings

Manually or with plugins like [Cosmetic](https://www.npmjs.com/package/cosmetic)

```
workingBar.character = '\x1b[36m-----\x1b[0m'
workingBar.front = cosmetic.green('Green Front: [');
<!-- Or -->
workingBar.before = '\x1b[36m-'
workingBar.character = '-\x1b[0m'
```

Set both before and after empty characters at the same time
Only one character strings accepted currently

```
workingBar.empty = '0';
```

Stop process with an optional message

```
workingBar.stop('Work complete!');
```

Default values

```
workingBar.length = 40;
workingBar.front = '[';
workingBar.before = ' ';
workingBar.character = '-';
workingBar.after = ' ';
workingBar.back = ']';
workingBar.interval = 35; //(milliseconds)
```

## Authors

* **Jay Deaton** - [Github](https://github.com/jayrdeaton)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

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