{"_id":"superstack","_rev":"14-38d24b7425b3df0974127d63820a061e","name":"superstack","description":"long stack traces for node.js","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"superstack","version":"0.0.1","description":"long stack traces for node.js","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha --ui tdd --reporter list"},"repository":{"type":"git","url":"git://github.com/defunctzombie/node-superstack.git"},"keywords":["stacktrace","long","stack","trace"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/defunctzombie/node-superstack/issues"},"devDependencies":{"mocha":"~1.13.0","after":"~0.8.1"},"_id":"superstack@0.0.1","dist":{"shasum":"b654b3972aba2225b9908e83424db60aa6b48ee4","tarball":"https://registry.npmjs.org/superstack/-/superstack-0.0.1.tgz","integrity":"sha512-gktudtUAMbcbsj7n3WZU/Nrnp1iwMaYn+gsyzuPhqdfduN62oevkRIJot/RNrnYRDNSBimxxvebrXJaKd0ecCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6wDVZCZugf2YO4qu2/+lmxkmlWP1RnDg7mKvemNusQAiB1ZEPAmzsan739ZiiWf5SfCnyEjEiaXNVYxkH1/U7Qtw=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.0.2":{"name":"superstack","version":"0.0.2","description":"long stack traces for node.js","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha --ui tdd --reporter list"},"repository":{"type":"git","url":"git://github.com/defunctzombie/node-superstack.git"},"keywords":["stacktrace","long","stack","trace"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/defunctzombie/node-superstack/issues"},"devDependencies":{"mocha":"~1.13.0","after":"~0.8.1"},"_id":"superstack@0.0.2","dist":{"shasum":"82e4e6da42a45c858583145c475c866f6dfc696c","tarball":"https://registry.npmjs.org/superstack/-/superstack-0.0.2.tgz","integrity":"sha512-Z+CsBhMoMtq9fsKFtqaQ64y0x76toTYzrTlHTAXEQ6ATqOkZmX9bHLWXXEGz9prYvcl0NL3rEy9Sxnx3pSx+Wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPakudlZg1N3+aBeN18EkzavT1ON6wsju/99Nnc2M9pAiAmGbCkwROSc7hKPFfi7ji3YxYlZRMllrFoEB2Dj36RHg=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.0.3":{"name":"superstack","version":"0.0.3","description":"long stack traces for node.js","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha --ui tdd --reporter list"},"repository":{"type":"git","url":"git://github.com/defunctzombie/node-superstack.git"},"keywords":["stacktrace","long","stack","trace"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/defunctzombie/node-superstack/issues"},"devDependencies":{"mocha":"~1.13.0","after":"~0.8.1"},"_id":"superstack@0.0.3","dist":{"shasum":"f7ae6e0e0a5531a292f335c254adab51dace5365","tarball":"https://registry.npmjs.org/superstack/-/superstack-0.0.3.tgz","integrity":"sha512-5h4XIxaRmVpz13/Q0Noug55uTifkVW7qAAKnc8C6AIWy9n5FL5Nayl2vxZnDY29hCpuPCCiOUvXjYQuNuG4DvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLif8MZECCjPJFuRx9TRgojxQK/QzWlYSv/K9FtxIN9AiEAlUvam9ItotfNemIz+62Uzc/MfUy63cYRf0xEnYMSKZA="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.0.4":{"name":"superstack","version":"0.0.4","description":"long stack traces for node.js","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha --ui tdd --reporter list"},"repository":{"type":"git","url":"git://github.com/defunctzombie/node-superstack.git"},"keywords":["stacktrace","long","stack","trace"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/defunctzombie/node-superstack/issues"},"devDependencies":{"mocha":"~1.13.0","after":"~0.8.1"},"homepage":"https://github.com/defunctzombie/node-superstack","_id":"superstack@0.0.4","dist":{"shasum":"6fe87b7913e0fd748ab33e333b5ae87eb020935c","tarball":"https://registry.npmjs.org/superstack/-/superstack-0.0.4.tgz","integrity":"sha512-rXSmMolQqqN+0kp6rkvcVxrByMDVApx9yUQ1ucwi1b9XwmnHSkDZgwPOtDTLYkYJWzNN9EPMPQLeKgncIuJ14w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCamBEtFvqfJ8ZocQumisOaF5VQ7zsZYWHYXsMX1OzQXAIhAN3J8E4lhPPBrU2XmVIe5xcQ1N7VCz75DdP4+vl2/7kL"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]}},"readme":"# superstack [![Build Status](https://travis-ci.org/defunctzombie/node-superstack.png?branch=master)](https://travis-ci.org/defunctzombie/node-superstack)\n\nlong stack traces for node.js over async/io boundaries\n\n## install\n\n```shell\nnpm install superstack\n```\n\n## use\n\nJust require `superstack` in your project. Ideally one of the first requires (see how it works for why)\n\n```js\nvar superstack = require('superstack');\n\nfunction f () {\n    throw new Error('foo');\n}\nsetTimeout(f, Math.random());\nsetTimeout(f, Math.random());\n```\n\nYour stack traces will now extend beyond async call boundaries. From the code above.\n\nBefore superstack\n```\nError: foo\n    at f [as _onTimeout] (.../node-superstack/foobar.js:2:11)\n    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)\n```\n\nWe have no idea which `setTimeout` call actually caused the error.\n\nAfter\n```\nError: foo\n    at f (/Users/shtylman/projects/node-superstack/foobar.js:4:11)\n    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)\n    at Object.<anonymous> (/Users/shtylman/projects/node-superstack/foobar.js:7:1)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Function.Module.runMain (module.js:497:10)\n    at startup (node.js:119:16)\n    at node.js:901:3\n```\n\nNotice that the stacktrace identifies which of the two `setTimeout` fired first and this caused the error.\n\n### options\n\n#### superstack.empty_frame\n\nBy default, the stacktrace appears as one long stacktrace. If you want to see the superstack framing boundaries set this value to a string and it will appear in the callstack.\n\n#### superstack.async_trace_limit\n\nSet this to a positive number to limit the number of frames superstack will capture. This is how many nested async calls back to report. A values of `-1` means unlimited. Default is `10`.\n\n#### superstack.format_stack\n\nFunction used by superstack to format the stacktrace string. See the implementation for default. The default conforms to the v8 stacktrace strings.\n\n## how it works\n\nSuperstack works by intercepting certain node.js EventEmitter, process, and Timer APIs. By intercepting the api call and injecting a wrapper callback, any error can be captured and additional frame information added via [Error.prepareStackTrace](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi)\n\nThe following calls are intercepted.\n\n### EventEmitter\n\n* on/addListener\n* once\n* removeListener\n* listeners\n\n### process\n\n* nextTick\n* _nextDomainTick\n\n### globals\n\n* setTimeout\n* setInterval\n* setImmediate\n\n## testing\n\nIf you find an instance of usage that is not properly captured, please open an issue and provide a testcase to reproduce.\n\nThe usual `npm test` can be run. A more rigorous set of tests can be run by running the `runme.sh` script in `test/modules`. It will clone a few popular node.js repos and run their test suits with superstack enabled. This helps ensure that there are limited side effects.\n\n## References\n\nThanks to [mattinsler/longjohn](https://github.com/mattinsler/longjohn) and [tlrobinson/long-stack-traces](https://github.com/tlrobinson/long-stack-traces) for the ideas and code. Longjohn code is MIT licensed.\n\nAlso relevant a pdf on the initial idea of [long stack traces](http://nodejs.org/illuminati0.pdf) via an EventSource.\n\n## License\n\nMIT\n","maintainers":[{"name":"defunctzombie","email":"shtylman@gmail.com"}],"time":{"modified":"2022-06-27T02:23:08.685Z","created":"2013-10-15T21:19:03.565Z","0.0.1":"2013-10-15T21:19:06.818Z","0.0.2":"2013-10-16T02:51:17.130Z","0.0.3":"2013-10-16T18:29:49.010Z","0.0.4":"2013-12-05T16:20:18.142Z"},"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"repository":{"type":"git","url":"git://github.com/defunctzombie/node-superstack.git"},"users":{"mhfrantz":true},"homepage":"https://github.com/defunctzombie/node-superstack","keywords":["stacktrace","long","stack","trace"],"bugs":{"url":"https://github.com/defunctzombie/node-superstack/issues"},"license":"MIT","readmeFilename":"README.md"}