Socket
Socket
Sign inDemoInstall

print-error

Package Overview
Dependencies
17
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    print-error

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


Version published
Weekly downloads
817
increased by152.94%
Maintainers
1
Install size
2.07 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 17 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc