youch-terminal

2.2.3 • Public • Published

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

/youch-terminal/

    Package Sidebar

    Install

    npm i youch-terminal

    Weekly Downloads

    27,179

    Version

    2.2.3

    License

    MIT

    Unpacked Size

    9.18 kB

    Total Files

    3

    Last publish

    Collaborators

    • virk
    • julien-r44