Gathering detailed insights and metrics for youch
Gathering detailed insights and metrics for youch
Gathering detailed insights and metrics for youch
Gathering detailed insights and metrics for youch
npm install youch
Typescript
Module System
Node Version
NPM Version
Update dependencies
Updated on Jul 04, 2025
Fix CSP issue
Updated on Jun 27, 2025
Add missing `@poppinss/colors` dependency
Updated on May 28, 2025
Mobile view styling fixes
Updated on Apr 09, 2025
Allow Node.js 18 via package.json engines
Updated on Mar 07, 2025
Toggle to view all frames, bug fixes and scripts cleanup
Updated on Jan 17, 2025
TypeScript (73.34%)
CSS (22.44%)
JavaScript (4.21%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,061 Stars
227 Commits
32 Forks
12 Watchers
4 Branches
15 Contributors
Updated on Jul 11, 2025
Latest Version
3.3.4
Package Id
youch@3.3.4
Unpacked Size
73.23 kB
Size
25.36 kB
File Count
6
NPM Version
10.8.2
Node Version
22.5.1
Published on
Oct 07, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Pretty error reporting for Node.js :rocket:
Youch is inspired by Whoops but with a modern design. Reading stack trace of the console slows you down from active development. Instead Youch print those errors in structured HTML to the browser.
Checkout youch terminal to beautify errors on terminal.
1npm i --save youch
Youch is used by AdonisJs, but it can be used by express or raw HTTP server as well.
1const Youch = require('youch') 2const http = require('http') 3 4http.createServer(async function (req, res) { 5 6 // PERFORM SOME ACTION 7 if (error) { 8 const youch = new Youch(error, req) 9 const html = await youch.toHTML() 10 11 res.writeHead(200, {'content-type': 'text/html'}) 12 res.write(html) 13 res.end() 14 } 15 16}).listen(8000)
Everytime an error occurs, we can help users we letting search for the error on Google, over even on the Github repo of our project.
Youch let you define clickable links to redirect the user to a website with the error message.
1const youch = new Youch(error) 2 3await youch 4 .addLink(({ message }) => { 5 const url = `https://stackoverflow.com/search?q=${encodeURIComponent(`[adonis.js] ${message}`)}` 6 7 return `<a href="${url}" target="_blank" title="Search on stackoverflow">Search stackoverflow</a>` 8 }) 9 .toHTML()
Also you can make use of Font awesome brands icons to display icons.
If you will use fontawesome icons, then Youch will automatically load the CSS files from the font awesome CDN for you.
1const youch = new Youch(error) 2 3await youch 4 .addLink(({ message }) => { 5 const url = `https://stackoverflow.com/search?q=${encodeURIComponent(`[adonis.js] ${message}`)}` 6 return `<a href="${url}" target="_blank" title="Search on stackoverflow"><i class="fab fa-stack-overflow"></i></a>` 7 }) 8 .toHTML()
When rendering HTML you can call the toggleShowAllFrames
method to check/uncheck the show all frames checkbox.
By default, the checkbox is not checked and calling this method once will toggle the state.
1const youch = new Youch(error)
2
3await youch
4 .toggleShowAllFrames()
5 .toHTML()
Youch HTML output outputs inline style
and script
tags and therefore you will have add nonce
attribute to them when you have enabled CSP on your website.
You can pass the cspNonce
property to the toHTML
method at the time of rendering the error to an HTML output.
1const youch = new Youch(error, req)
2const html = await youch.toHTML({
3 cspNonce: 'nonce-value'
4})
You can also the error stack frames as JSON by calling the .toJSON
method.
1const youch = new Youch(error, {})
2const jsonResponse = await youch.toJSON()
Following is the shape of the toJSON
return data type.
1type JsonResponse = { 2 error: { 3 message: string; 4 name: string; 5 status: number; 6 frames: { 7 file: string, 8 filePath: string, 9 line: number, 10 column: number, 11 callee: string, 12 calleeShort: string, 13 context: { 14 start: number, 15 pre: string, 16 line: string, 17 post: string, 18 }, 19 isModule: boolean, 20 isNative: boolean, 21 isApp: boolean 22 }[]; 23 }; 24}
Checkout CHANGELOG.md file for release history.
Checkout LICENSE.md for license information Harminder Virk (Aman) - https://github.com/thetutlage
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
12 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More