pretty-throw

Throw formatted errors.

Usage no npm install needed!

<script type="module">
  import prettyThrow from 'https://cdn.skypack.dev/pretty-throw';
</script>

README

Pretty throw Travis CI Build Status

Throw formatted errors.

NPM Badge

Install

npm install pretty-throw

Usage

const prettyThrow = require("pretty-throw");
prettyThrow(new Error("Test error."));

Output

Example output

API

prettyThrow(error, options?)

error

Type: Error

The error to be thrown.

options

Type: object

exit

Type: boolean
Default: true

Exit the process after displaying the error.