# promise.bar

> Progress bar to animate the status of Promise.all

Latest version **0.1.5** (published 2017-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise.bar
pnpm add promise.bar
yarn add promise.bar
bun add promise.bar
```

## 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.1.5 |
| Published | 2017-08-18 |
| First published | 2017-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Ryan Leonard |
| Maintainers | codelenny |
| Keywords | progress-bar, progressbar, progress, bar, status, ascii, console, terminal, cli |

## Links

- npm: https://www.npmjs.com/package/promise.bar
- Repository: https://github.com/CodeLenny/Promise.bar
- Homepage: https://github.com/CodeLenny/Promise.bar#readme
- Issues: https://github.com/CodeLenny/Promise.bar/issues
- npm.io page: https://npm.io/package/promise.bar

## Dependencies (3)

- [ansi](https://npm.io/package/ansi.md) ^0.3.1
- [pathval](https://npm.io/package/pathval.md) ^1.1.0
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^3.0.1

## 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.1.5 (latest) — 2017-08-18
- 0.1.4 — 2017-02-16
- 0.1.3 — 2017-02-10
- 0.1.2 — 2017-02-09
- 0.1.1 — 2017-02-08
- 0.1.0 — 2017-02-08

## README

# Promise.bar

<div align="center">
  <img src="https://cloud.githubusercontent.com/assets/9272847/22797422/28f948ba-eecc-11e6-82de-e6c283528b6a.png">
</div>

[![Promise.bar on NPM](https://img.shields.io/npm/v/promise.bar.svg)](https://www.npmjs.com/package/promise.bar)

## Usage

Doing a bunch of tasks asynchronously with promises, and want a status indicator?

```javascript
let compiles = [
  compile("a.coffee"),
  compile("b.coffee")
];
Promise.all(compiles).then(() => {
  console.log("Compile Done!");
});
```

Simply replace `Promise.all` with `PromiseBar.all`, and watch a progress bar fill as compilations finish!

```javascript
let PromiseBar = require("promise.bar");
PromiseBar.enable();

PromiseBar.all(compiles, {label: "Minify"}).then(() -> {
  console.log("Compile Done!");
});
```

(Install PromiseBar via `npm install --save promise.bar`)

### Alias as `Promise.bar`

Make PromiseBar even cuter.

```javascript
Promise.bar = function() {
  return PromiseBar.all(arguments);
};
```

### Stacked Progress Bars

Want to stack progress bars?

```javascript
child = PromiseBar.all([], {label: "Child"});
parent = PromiseBar.all([child], {label: "Parent"});
```

The child will automatically be indented under the parent.  Disable this for a progress bar by passing `flat: false` to
`PromiseBar#all`, or disable it for all progress bars with `PromiseBar.conf.flat = false;`.

### Color the Progress Bar

Add colors to your progress bars with libraries like [Chalk][].

```javascript
let chalk = require("chalk");

PromiseBar.all([], {label: chalk.blue("Progress"), barFormat: chalk.dim.blue});
```

The label will be colored blue, and the progress bar will be light blue.  You can provide any function to `barFormat`
to transform the output.

### Always Below `console.log` Content

Progress bars will always appear under other `stdout` content.

### All Options

Promise.bar supports much more customization than the options listed here.  Please check out the
[full API documentation][PromiseBar#all] for other configurable options.

[Chalk]: https://github.com/chalk/chalk
[PromiseBar#all]: https://promisebar.codelenny.com/#https://promisebar.codelenny.com/class/PromiseBar.html#all-dynamic

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