{"name":"nested-error-stacks","version":"2.0.0","description":"An Error subclass that will chain nested Errors and dump nested stacktraces","bugs":{"url":"https://github.com/mdlavin/nested-error-stacks/issues"},"keywords":["error","nested","stack"],"repository":{"type":"git","url":"git+https://github.com/mdlavin/nested-error-stacks.git"},"main":"index.js","files":["index.js","LICENSE"],"scripts":{"test":"if node --version | grep -vE 'v(0|3)' > /dev/null 2>&1; then eslint . || exit -1; fi; if [ \"$RUN_ZUUL\" != \"true\" ]; then node_modules/.bin/mocha; else npm install zuul && node_modules/.bin/zuul -- test.js; fi"},"author":{"name":"Matt Lavin","email":"matt.lavin@gmail.com"},"license":"MIT","dependencies":{"inherits":"~2.0.1"},"devDependencies":{"chai":"^3.5.0","eslint":"^3.9.1","mocha":"^3.1.2","uuid":"^2.0.3"},"gitHead":"b9c587d406292eb9af2416e5638c1fa5a3846e7c","homepage":"https://github.com/mdlavin/nested-error-stacks#readme","_id":"nested-error-stacks@2.0.0","_shasum":"98b2ffaefb4610fa3936f1e71435d30700de2840","_from":".","_npmVersion":"2.15.1","_nodeVersion":"0.10.48","_npmUser":{"name":"mdlavin","email":"matt.lavin@gmail.com"},"dist":{"shasum":"98b2ffaefb4610fa3936f1e71435d30700de2840","tarball":"http://registry-npm.ywwl.com/nested-error-stacks/download/nested-error-stacks-2.0.0.tgz","integrity":"sha512-i1rkX6AxvF0eg/MBhMGP5cKMq6dhvHvcL65zK7HcOB+sVbqLL75NK7h+LAEUwH2z0O8Kv5vHE9QtSvjP0N7AAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfAk5f6XiOwmZsb6VI56UFe+o6GajrenxnKnmAm7rAdgIgfNS3zBlJtMGuoSPlYIyku2+TQzAO89NHa1Ao6zu0tV4="}],"size":2581,"noattachment":false,"key":"/nested-error-stacks/-/nested-error-stacks-2.0.0.tgz"},"maintainers":[{"name":"mdlavin","email":"matt.lavin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/nested-error-stacks-2.0.0.tgz_1478705056336_0.8261979138478637"},"directories":{},"readme":"Nested stacktraces for Node.js!\n===============================\n\n[![Build Status](https://github.com/mdlavin/nested-error-stacks/actions/workflows/test.yaml/badge.svg)](https://github.com/mdlavin/nested-error-stacks/actions?query=branch%3Amaster)\n[![NPM version](https://badge.fury.io/js/nested-error-stacks.svg)](http://badge.fury.io/js/nested-error-stacks)\n\nWith this module, you can wrap a caught exception with extra context\nfor better debugging.  For example, a network error's stack would normally look\nlike this:\n\n    Error: connect ECONNREFUSED\n        at errnoException (net.js:904:11)\n        at Object.afterConnect [as oncomplete] (net.js:895:19)\n\nUsing this module, you can wrap the Error with more context to get a stack\nthat looks like this:\n\n    NestedError: Failed to communicate with localhost:8080\n        at Socket.<anonymous> (/Users/mattlavin/Projects/nested-stacks/demo.js:6:18)\n        at Socket.EventEmitter.emit (events.js:95:17)\n        at net.js:440:14\n        at process._tickCallback (node.js:415:13)\n    Caused By: Error: connect ECONNREFUSED\n        at errnoException (net.js:904:11)\n        at Object.afterConnect [as oncomplete] (net.js:895:19)\n\nHow to wrap errors\n------------------\n\nHere is an example program that uses this module to add more context to errors:\n\n```js\nvar NestedError = require('nested-error-stacks');\nvar net = require('net');\n    \nvar client = net.connect({port: 8080});\nclient.on('error', function (err) {\n    var newErr = new NestedError(\"Failed to communicate with localhost:8080\", err);\n    console.log(newErr.stack);\n});\n```\n\nHow to inherit\n--------------\n\nIt is recommended to use explicit names for Error classes. You can do it\nlike this:\n\n```js\nvar util = require('util');\nvar NestedError = require('nested-error-stacks');\n\nfunction MyError(message, nested) {\n    NestedError.call(this, message, nested);\n}\n\nutil.inherits(MyError, NestedError);\nMyError.prototype.name = 'MyError';\n```\n","publish_time":1478705056887,"_cnpm_publish_time":1478705056887,"dist-tags":{"latest":"2.1.1"}}