Socket
Socket
Sign inDemoInstall

youch-terminal

Package Overview
Dependencies
7
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    youch-terminal

Show youch error on terminal


Version published
Weekly downloads
27K
increased by4.29%
Maintainers
2
Install size
131 kB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 23 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc