# @springernature/util-cli-reporter

> Standardised CLI Logging

Latest version **2.0.0** (published 2021-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @springernature/util-cli-reporter
pnpm add @springernature/util-cli-reporter
yarn add @springernature/util-cli-reporter
bun add @springernature/util-cli-reporter
```

## 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.0.0 |
| Published | 2021-12-28 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 226.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Kilgour |
| Maintainers | sonniesedge, rlau, dotcode, joseluisbolos, hollsk, moddular, jpw, nickcall, howlingmad, sndigital, davidpauljunior, morgaan, nasiamakryg |

## Links

- npm: https://www.npmjs.com/package/@springernature/util-cli-reporter
- Repository: https://github.com/springernature/frontend-toolkit-utilities
- Homepage: https://github.com/springernature/frontend-toolkit-utilities/tree/master/packages/util-cli-reporter#readme
- Issues: https://github.com/springernature/frontend-toolkit-utilities/issues
- npm.io page: https://npm.io/package/@springernature/util-cli-reporter

## Dependencies (2)

- [kleur](https://npm.io/package/kleur.md) ^4.1.4
- [log-symbols](https://npm.io/package/log-symbols.md) ^4.1.0

## Recent versions

- 2.0.0 (latest) — 2021-12-28
- 1.2.1 — 2020-10-05
- 1.2.0 — 2020-09-23
- 1.1.1 — 2020-04-28
- 1.1.0 — 2019-10-15
- 1.0.0 — 2019-10-09
- 0.0.2 — 2019-09-25
- 0.0.1 — 2019-09-17

## README

# CLI Reporter

[![NPM version][badge-npm]][info-npm]
[![Node version][badge-node]][info-node]
![MIT License][badge-license]

Standardised command-line reporter for frontend toolkit modules.

## Install

```
$ npm install @springernature/util-cli-reporter
```

## Usage

```javascript
const reporter = require('@springernature/util-cli-reporter');

// Optionally initialise with a logging level
// Defaults to title (all)
reporter.init('title');

reporter.title('this is a heading');

reporter.info('description');
reporter.info('description', 'this is my message');
reporter.info('description', 'this is my message', 'to you');

reporter.success('description');
reporter.success('description', 'this is my message');
reporter.success('description', 'this is my message', 'to you');

reporter.warning('description');
reporter.warning('description', 'this is my message');
reporter.warning('description', 'this is my message', 'to you');

reporter.fail('description');
reporter.fail('description', 'this is my message');
reporter.fail('description', 'this is my message', 'to you');
```

> NOTE: you can run this demo from [demo/index.js](./demo/index.js)

### Logging levels

By running the `reporter.init()` function you can set the following logging levels

#### `reporter.init('title')`

* Prints all reporting types - `title`, `info`, `success`, `warning`, `fail`

#### `reporter.init('info')`

* Prints the reporting types - `info`, `success`, `warning`, `fail`
* Ignores the reporting types - `title`

#### `reporter.init('success')`

* Prints the reporting types - `success`, `warning`, `fail`
* Ignores the reporting types - `title`, `info`

#### `reporter.init('warning')`

* Prints the reporting types - `warning`, `fail`
* Ignores the reporting types - `title`, `info`, `success`

#### `reporter.init('fail')`

* Prints the reporting types - `fail`
* Ignores the reporting types - `title`, `info`, `success`, `warning`

#### `reporter.init('none')`

* Ignores all reporting types - `title`, `info`, `success`, `warning`, `fail`

### Output

![example output](img/example.png)

## License

[MIT License][info-license] &copy; 2019, Springer Nature

[info-npm]: https://www.npmjs.com/package/@springernature/util-cli-reporter
[badge-npm]: https://img.shields.io/npm/v/@springernature/util-cli-reporter.svg
[info-license]: https://github.com/springernature/frontend-toolkit-utilities/blob/master/LICENCE
[badge-license]: https://img.shields.io/badge/license-MIT-blue.svg
[badge-node]: https://img.shields.io/badge/node->=8-brightgreen.svg
[info-node]: package.json

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