❗ hazlines has replaced this and handles more scenarios |
---|
Create fuller stacktraces, remove all internal lines and gray out modules.
You probably don't want to run this in production. It's great for development and testing, but in production it will slow your app down a great deal.
if (process.env.NODE_ENV !== 'production') {
require('async-bugs')
}
The normal mode uses trace
and trace-cleaner
to give you stack traces that are organised
and minimised to only the stacks still in scope.
There are some cases the normal mode can not handle. For example if you are doing some crazy Error extending and it still loses the stack trace. In that case, the verbose mode simple logs every async call and outputs it on error. It'll be long, but the call should be there.
npm install --save async-bugs
Include in your app:
require('async-bugs')
require('async-bugs/verbose')
Or add when running node:
node -r async-bugs
node -r async-bugs/verbose