errors with clean stacks
Made with ❤ at @outlandish
npm install --save error-clean-stack
yarn add error-clean-stack
// ES2015
import cleanErrors from 'error-clean-stack'
// CommonJS
var cleanErrors = require('error-clean-stack')
All errors are exported as named exports.
Error
ReferenceError
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
const {Error} = require('error-clean-stack')
function a () {
function b () {
throw new Error()
}
b()
}
a()
$ node examples/error.js
C:\xampp\htdocs\error-clean-stack\examples\error.js:5
throw new Error()
^
Error
at b (C:/xampp/htdocs/error-clean-stack/examples/error.js:5:11)
at a (C:/xampp/htdocs/error-clean-stack/examples/error.js:7:3)
at Object.<anonymous> (C:/xampp/htdocs/error-clean-stack/examples/error.js:10:1)
All pull requests and issues welcome!
If you're not sure how, check out the great video tutorials on egghead.io!
MIT © Sam Gluck