[Node.js] Prettify the details of the errors in the console
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.npmignore
LICENSE
README.md
index.js
package.json

README.md

error-render

Actual version published on NPM Dependencies

Install

npm install error-render --save

Usage

var er    = require('error-render');
var error = new Error('Whoops !');

// pretty error with the details (metadata)
console.error(er.details(error));

// shortcut of console.error(er.details(error));
er.log(error)

Pretty JSON

er.prettyJson(error);

Pretty error without the metadata of the error instance

var pe = new er.PrettyError();

console.error(pe.render(error));

Provided by pretty-error

Unit tests

error-render is tested with Unit.js

Run the tests

cd node_modules/error-render

npm test

LICENSE

MIT license

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal