@nuxtjs/youch

Pretty error reporting for Node.js 🚀 (Modified for Nuxt.js & SSR Bundles)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@nuxtjs/youch
2914.2.36 years ago7 years agoMinified + gzip package size for @nuxtjs/youch in KB

Readme

Youch!
Pretty error reporting for Node.js 🚀 (Modified for Nuxt.js & SSR Bundles)



<img src="https://user-images.githubusercontent.com/5158436/28990900-0a4766f8-7997-11e7-9f0b-4336fa2e2e0b.png" style="width: 600px;" />






!NPM Versionnpm-imagenpm-url !Build Statustravis-imagetravis-url !Downloads Statsnpm-downloadsnpm-url !Appveyorappveyor-imageappveyor-url
!Gitter Channelgitter-imagegitter-url !Trellotrello-imagetrello-url !Patreonpatreon-imagepatreon-url
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.

Features

  1. HTML reporter
  2. JSON reporter, if request accepts a json instead of text/html.
  3. Sorted frames of error stack.

Installation

npm i --save @nuxtjs/youch

Basic Usage

Youch is used by AdonisJs and Nuxt.js, but it can be used by express or raw HTTP server as well.
const Youch = require('@nuxtjs/youch')
const http = require('http')

http.createServer(function (req, res) {

  // PERFORM SOME ACTION
  if (error) {
    const youch = new Youch(error, req)

    youch
    .toHTML()
    .then((html) => {
      res.writeHead(200, {'content-type': 'text/html'})
      res.write(html)
      res.end()
    })
  }

}).listen(8000)

Release History

Checkout CHANGELOG.md file for release history.

Meta

Checkout LICENSE.txt for license information Harminder Virk (Aman) - https://github.com/thetutlage