Socket
Socket
Sign inDemoInstall

youch-terminal

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youch-terminal - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

19

index.js

@@ -13,4 +13,5 @@ 'use strict'

const { platform, cwd } = process
const { sep } = require('path')
const wordwrap = require('wordwrap')
const { fileURLToPath } = require('url')
const { sep, relative } = require('path')
const stringWidth = require('string-width')

@@ -22,3 +23,13 @@ const { dim, yellow, green, red, cyan } = require('kleur')

const DASH = platform === 'win32' && !process.env.WT_SESSION ? '⁃' : '⁃'
const CWD = cwd()
function getRelativePath(filePath) {
/**
* Node.js error stack is all messed up. Some lines have file info
* enclosed in parenthesis and some are not
*/
filePath = filePath.replace('async file:', 'file:')
return relative(CWD, filePath.startsWith('file:') ? fileURLToPath(filePath) : filePath)
}
/**

@@ -133,3 +144,3 @@ * Pulls the main frame from the frames stack

function getHelpText(error, prefix) {
const help = error.help
let help = error.help
if (!help) {

@@ -176,3 +187,3 @@ return []

const filePath = displayShortPath ? frame.filePath.replace(`${cwd()}${sep}`, '') : frame.filePath
const filePath = displayShortPath ? getRelativePath(frame.filePath) : frame.filePath
return [`${prefix} at ${yellow(`${frameMethod(frame)}`)} ${green(filePath)}:${green(frame.line)}`]

@@ -231,3 +242,3 @@ }

const filePath = displayShortPath
? frame.filePath.replace(`${cwd()}${sep}`, '')
? getRelativePath(frame.filePath)
: frame.filePath

@@ -234,0 +245,0 @@

{
"name": "youch-terminal",
"version": "2.2.1",
"version": "2.2.2",
"description": "Show youch error on terminal",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc