Make a color-coded stack trace from an error
npm install neat-stack


Make a color-coded stack trace from an error
``javascript
const neatStack = require('neat-stack');
const request = require('request');
request('foo', err => console.error(neatStack(err)));
`
Useful for CLI applications — stack traces are not very important for end users but needed for authors to receive meaningful bug reports.
``
npm install neat-stack
`javascript`
const neatStack = require('neat-stack');
error: Error string
Return:
It returns a refined Error#stack:
* Red-colored by ANSI escape code.
* Lines starting with ' at' are dimmed.~
* Any lines from Node.js internals are omitted.
* Paths are simplified by replacing a home directory with on POSIX.
`javascript
const error = new Error('Hi');
error.stack; /* => Error: Hi
at Object.
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) */
neatStack(error); /* => \u001b31mError: Hi\u001b[2m
at Object. */``
[ISC License © 2017 - 2018 Shinnosuke Watanabe