# cli-progress-footer

> [![Build status][build-image]][build-url] [![Tests coverage][cov-image]][cov-url] [![npm version][npm-image]][npm-url]

Latest version **2.3.3** (published 2024-02-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install cli-progress-footer
pnpm add cli-progress-footer
yarn add cli-progress-footer
bun add cli-progress-footer
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.3 |
| Published | 2024-02-29 |
| First published | 2018-10-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 7 |
| Unpacked size | 29.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Mariusz Nowak |
| Maintainers | medikoo |

## Links

- npm: https://www.npmjs.com/package/cli-progress-footer
- Repository: https://github.com/medikoo/cli-progress-footer
- Homepage: https://github.com/medikoo/cli-progress-footer#readme
- Issues: https://github.com/medikoo/cli-progress-footer/issues
- npm.io page: https://npm.io/package/cli-progress-footer

## Dependencies (7)

- [d](https://npm.io/package/d.md) ^1.0.1
- [type](https://npm.io/package/type.md) ^2.7.2
- [es5-ext](https://npm.io/package/es5-ext.md) ^0.10.64
- [cli-color](https://npm.io/package/cli-color.md) ^2.0.4
- [timers-ext](https://npm.io/package/timers-ext.md) ^0.1.7
- [mute-stream](https://npm.io/package/mute-stream.md) 0.0.8
- [process-utils](https://npm.io/package/process-utils.md) ^4.0.0

## Recent versions

- 2.3.3 (latest) — 2024-02-29
- 2.3.2 — 2022-05-30
- 2.3.1 — 2022-03-31
- 2.3.0 — 2021-12-09
- 2.2.0 — 2021-11-24
- 2.1.1 — 2021-09-22
- 2.1.0 — 2021-09-22
- 2.0.2 — 2021-09-14
- 2.0.1 — 2021-09-10
- 2.0.0 — 2021-09-06
- 1.1.1 — 2019-02-21
- 1.1.0 — 2018-11-15
- 1.0.0 — 2018-10-23

## README

[![Build status][build-image]][build-url]
[![Tests coverage][cov-image]][cov-url]
[![npm version][npm-image]][npm-url]

# cli-progress-footer

## Manage dynamic progress content below std output stream

Content agnostic. For reliable output all of process std output needs go through this utility. To ensure that by default `process.stdout.write` is overriden and `process.stderr` is redirected into `process.stdout` (with possibility to opt out from both).

### Installation

```sh
npm install cli-progress-footer
```

### Usage

```javascript
const cliProgressFooter = require("cli-progress-footer")();

// Write progress
cliProgresssFooter.updateProgress("# processing 1\n# processing 2\n# processing 3\n");
...
// Update progress content when necessary
cliProgresssFooter.updateProgress("# processing 2\n# processing 3\n# processing 4\n");
...
// Update progress content when necessary
cliProgresssFooter.updateProgress("# processing 3\n# processing 4\n");
```

By default both `stdout` and `stderr` output is automatically handled and ensured to appear above progress content

### Options

##### overrideStdout `bool` _(default: `true`)_

Whether to override data written to `process.stdout` stream so it appears in all cases above progress bar.
Modified writes are passed immediately to native `process.stdout.write` so there's no risk of losing some log content or seing it out of sync

You may opt out but then if any content is written to `process.stdout`, process output may appear as not reliable.

When opting out you may write regular log content via `cliProgressFooter.writeStdout(data)`

##### redirectStderr `bool` _(default: `true`)_

When progress footer is in play, all output should be treated as one `std` stream. If it's not the case then
any `stderr` output may break visible log output. Therefore by default all `stderr` content is redirected to `stdout`.

If you wish to redirect `stderr` somewhere else with cli means, then it's best turn this function off (so `proces.stderr.write` is not overriden)

##### discardStdin `bool` _(default: `true`)_

Whether to mute stdin input (so it doesn't add to displayed progress output). In scope of that setting also cursor is hidden

##### workaroundChildProcess `bool` _(default: `true`)_

Whether to hide a progress bar for a time being of child process runs with inherited `stdio`.

Problem is that output of such processes cannot be controlled, and if happens will break the progress bar output.

Internal workaround is to decorate `child_process` module functions, and react accordingly whenever problematic child process is created

#### Throbber animation

Additionally each progress line may be automatically prefixed with throbber (frames customizable at `cliProgresssFooter.progressAnimationPrefixFrames`), for that apply following setting:

```javascript
cliProgressFooter.shouldAddProgressAnimationPrefix = true;
```

### Tests

```sh
npm test
```

[build-image]: https://github.com/medikoo/cli-progress-footer/workflows/Integrate/badge.svg
[build-url]: https://github.com/medikoo/cli-progress-footer/actions?query=workflow%3AIntegrate
[cov-image]: https://img.shields.io/codecov/c/github/medikoo/cli-progress-footer.svg
[cov-url]: https://codecov.io/gh/medikoo/cli-progress-footer
[npm-image]: https://img.shields.io/npm/v/cli-progress-footer.svg
[npm-url]: https://www.npmjs.com/package/cli-progress-footer

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