clean-stack
Clean up error stack traces
Removes the mostly unhelpful internal Node.js entries.
Also works in Electron.
Install
$ npm install clean-stack
Usage
const cleanStack = require('clean-stack');
const error = new Error('Missing unicorn');
console.log(error.stack);
console.log(cleanStack(error.stack));
API
cleanStack(stack, [options])
stack
Type: string
The stack
property of an Error
.
options
Type: Object
pretty
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
Related
License
MIT © Sindre Sorhus