JSPM

  • Created
  • Published
  • Downloads 2736206
  • Score
    100M100P100Q211849F
  • License MIT

HTML Pretty error stack viewer

Package Exports

  • youch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (youch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Youch!

Pretty error reporting for Node.js 🚀





NPM Version Build Status Downloads Stats Appveyor

Gitter Channel Trello Patreon

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.

Checkout youch terminal to beautify errors on terminal.

Installation

npm i --save youch

Basic Usage

Youch is used by AdonisJs, but it can be used by express or raw HTTP server as well.

const Youch = require('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.md for license information Harminder Virk (Aman) - https://github.com/thetutlage