Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Latest commit

 

History

History
55 lines (38 loc) · 1.68 KB

File metadata and controls

55 lines (38 loc) · 1.68 KB

Super stack trace

Build Status npm

It provides support for “long stack traces,” wherein the stack property of Error rejection reasons is rewritten to be traced along asynchronous jumps instead of stopping at the most recent one.

The heavy lifting is made by async-listener, which is a polyfill for an experimental API that had a short-life in node.js (v0.11.x only) and was removed.

Installation

$ npm install superstacktrace

Tested on iojs v1.6.3.

Example

require('superstacktrace');

// That's it.

Stack trace example:

Error: boom!
    at /home/user/project/test/test.js:166:23
    at /home/user/project/node_modules/async-listener/glue.js:188:31
    at process._tickDomainCallback [as _tickCallback] (node.js:366:13)
From previous event:
    at asyncWrap (/home/user/project/node_modules/async-listener/glue.js:150:28)
    at wrapCallback (/home/user/project/node_modules/async-listener/glue.js:401:35)
    at process.nextTick (/home/user/project/node_modules/async-listener/index.js:16:26)
    at myNestedFunction [as _onTimeout] (/home/user/project/test/test.js:165:25)
    at Timer.listOnTimeout (timers.js:89:15)

There are some lines including the async-listener library, I thought about filtering them out, but then I realise, if that's the real cause of the error it would be hidden.

Running tests

$ mocha

License

MIT