Detalhes do pacote

youch-terminal

poppinss189.5kMIT2.2.3

Show youch error on terminal

readme (leia-me)

Youch terminal

This package converts the youch error message to a string to be displayed on terminal. The output of the function is colorized using chalk.

Install

npm i youch-terminal

Usage

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

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))

changelog (log de mudanças)

2.1.5 (2022-09-03)

2.1.4 (2022-05-17)

2.1.3 (2022-02-22)

2.1.2 (2022-01-31)

  • Fix line numbers spacing

2.1.1 (2022-01-28)

  • Add "hideMessage" and "displayMainFrameOnly" options

2.1.0 (2022-01-19)

  • Allow options to tweak the output behavior

2.0.1 (2022-01-16)

  • Upgrade to youch@3.1.0

2.0.0 (2021-12-18)

  • Upgrade to youch@3.0.0

1.1.0 (2021-03-21)

1.0.1 (2020-10-01)

1.0.0 (2018-01-19)

Features