highlights the name of local (not in node_modules) files in error stack
npm install highlight-stackA module to make it easier for humans to read logged stack traces in node.
This module will remove the current working directory from all paths, highlight
local file paths and node_modules' names and fade all lines referring to node
internals.
```
$ npm install @bmp/highlight-stack
General
`[${e.name}] ${e.message}
try {
doDodgyStuff()
} catch (e) {
console.error( )
if (error.stack) {
console.error(highlightStack(e.stack.slice(e.stack.indexOf('\n') + 1)).trim())
}
}
`
To make uncaught exceptions easier to read:
`
const hightlightStack = require('@bmp/highlight-stack')
process.on('uncaughtException', (err) => {
console.error(chalk.red('UNCAUGHT EXCEPTION'))
if (err.stack) {
console.error(highlightStack(err.stack))
} else {
console.error(err)
}
process.exit(1)
})
``