0.1.17 • Published 6 years ago

print-error v0.1.17

Weekly downloads
1,017
License
MIT
Repository
github
Last release
6 years ago

print-error

npm version npm downloads coverage

Prints javascript error stack trace in different flavours:

  • pretty-print coloured terminal (demo)
  • HTML (demo)
  • markdown (demo)
  • plain text (demo)

Installation

npm install print-error --save

Usage

import {
	html,
	htmlErrorStack,
	HTML_STYLE,
	markdown,
	terminal
} from 'print-error'

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

// Outputs just the contents of the `<body/>` of the HTML page.
htmlErrorStack(new Error())

// Outputs Markdown.
markdown(new Error())

// Outputs colored terminal output.
terminal(new Error())

Terminal

This library uses pretty-error for coloured terminal error stack trace printing.

Contributing

After cloning this repo, ensure dependencies are installed by running:

npm install

This module is written in ES6 and uses Babel for ES5 transpilation. Widely consumable JavaScript can be produced by running:

npm run build

Once npm run build has run, you may import or require() directly from node.

After developing, the full test suite can be evaluated by running:

npm test

When you're ready to test your new functionality on a real project, you can run

npm pack

It will build, test and then create a .tgz archive which you can then install in your project folder

npm install [module name with version].tar.gz

License

MIT

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago