An open API service indexing awesome lists of open source software.

https://github.com/catamphetamine/print-error

Javascript print error stack trace (pretty, terminal, html, markdown, etc)
https://github.com/catamphetamine/print-error

Last synced: about 1 month ago
JSON representation

Javascript print error stack trace (pretty, terminal, html, markdown, etc)

Awesome Lists containing this project

README

        

# print-error

[![npm version](https://img.shields.io/npm/v/print-error.svg?style=flat-square)](https://www.npmjs.com/package/print-error)
[![npm downloads](https://img.shields.io/npm/dm/print-error.svg?style=flat-square)](https://www.npmjs.com/package/print-error)
[![coverage](https://img.shields.io/coveralls/catamphetamine/print-error/master.svg?style=flat-square)](https://coveralls.io/r/catamphetamine/print-error?branch=master)

Prints javascript error stack trace in different flavours:

* `pretty-print` coloured terminal ([demo](https://github.com/AriaMinaei/pretty-error))
* HTML ([demo](https://github.com/catamphetamine/print-error/tree/master/test/examples/error.html))
* markdown ([demo](https://github.com/catamphetamine/print-error/tree/master/test/examples/error.md))
* plain text ([demo](https://github.com/catamphetamine/print-error/tree/master/test/examples/error.txt))

## Installation

```
npm install print-error --save
```

## Usage

```js
import {
html,
htmlErrorStack,
HTML_ERROR_STACK_STYLE,
markdown,
terminal
} from 'print-error'

// Outputs an HTML page.
html(new Error(), { fontSize: '16px' })

// Outputs just the contents of the `