# youch-terminal

> Show youch error on terminal

Latest version **2.2.3** (published 2023-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install youch-terminal
pnpm add youch-terminal
yarn add youch-terminal
bun add youch-terminal
```

## 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.2.3 |
| Published | 2023-09-23 |
| First published | 2018-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 88 |
| Author | virk |
| Maintainers | virk, julien-r44 |

## Links

- npm: https://www.npmjs.com/package/youch-terminal
- Repository: https://github.com/poppinss/youch-terminal
- Homepage: https://github.com/poppinss/youch-terminal#readme
- Issues: https://github.com/poppinss/youch-terminal/issues
- npm.io page: https://npm.io/package/youch-terminal

## Dependencies (3)

- [kleur](https://npm.io/package/kleur.md) ^4.1.5
- [wordwrap](https://npm.io/package/wordwrap.md) ^1.0.0
- [string-width](https://npm.io/package/string-width.md) ^4.2.3

## Recent versions

- 2.2.3 (latest) — 2023-09-23
- 2.2.2 — 2023-07-05
- 2.2.1 — 2023-06-26
- 2.2.0 — 2023-02-07
- 2.1.5 — 2022-09-02
- 2.1.4 — 2022-05-17
- 2.1.3 — 2022-02-22
- 2.1.2 — 2022-01-31
- 2.1.1 — 2022-01-28
- 2.1.0 — 2022-01-19
- 2.0.1 — 2022-01-16
- 2.0.0 — 2021-12-18
- 1.1.1 — 2021-05-04
- 1.1.0 — 2021-03-22
- 1.0.1 — 2020-10-01
- … 1 more at https://npm.io/package/youch-terminal/versions

## README

# Youch terminal

![](youch-terminal.jpeg)

This package converts the [youch](https://npmjs.com/package/youch) error message to a string to be displayed on terminal. The output of the function is colorized using [chalk](https://npmjs.com/package/chalk).

## Install
```
npm i youch-terminal
```

## Usage
Make sure you pass the output `toJSON` to the youch terminal function.

```js
const Youch = require('youch')
const forTerminal = require('youch-terminal')

const error = new Error('Some weird error')
const jsonResponse = await new Youch(error, {}).toJSON()

const options = {
  // Defaults to false
  displayShortPath: false,

  // Defaults to single whitspace
  prefix: ' ',

  // Defaults to false
  hideErrorTitle: false,

  // Defaults to false
  hideMessage: false,

  // Defaults to false
  displayMainFrameOnly: false,

  // Defaults to 3
  framesMaxLimit: 3,
}

console.log(forTerminal(output, options))
```

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