Clean up error stack traces
Removes the mostly unhelpful internal Node.js entries.
Also works in Electron.
$ npm install clean-stack
```js const cleanStack = require('clean-stack');
const error = new Error('Missing unicorn');
console.log(error.stack);
/
Error: Missing unicorn
at Object.
console.log(cleanStack(error.stack));
/
Error: Missing unicorn
at Object.
Type: string
The stack
property of an Error
.
Type: Object
Type: boolean
Default: false
Prettify the file paths in the stack:
/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15
→ ~/dev/clean-stack/unicorn.js:2:15
MIT © Sindre Sorhus