{"name":"nested-error-stacks","version":"2.1.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","devDependencies":{"chai":"^3.5.0","eslint":"^3.9.1","mocha":"^3.1.2","uuid":"^2.0.3"},"gitHead":"cdcf5fb17f0dcecaa56428510b08b0c52ce605b1","homepage":"https://github.com/mdlavin/nested-error-stacks#readme","_id":"nested-error-stacks@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"mdlavin","email":"matt.lavin@gmail.com"},"dist":{"integrity":"sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==","shasum":"0fbdcf3e13fe4994781280524f8b96b0cdff9c61","tarball":"http://registry-npm.ywwl.com/nested-error-stacks/download/nested-error-stacks-2.1.0.tgz","fileCount":5,"unpackedSize":5453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcYdVCRA9TVsSAnZWagAAzG8P/RcB+Dz63x+6Bk+tAK3W\njcdD05rcToqVXREe1XV0rxX+8zXYiz2VQ7Hbdwmlb6OxtDQe+OdKjcWQzJ8a\n7192dWXYKf8w+KyUa0yqB9aqZfCkBYTdqTeMNtfYkRAdQ7vGnSsixiYiuqsk\nzNVdMFIKdV1QVRgEGuM6095BwPKUWceB5y2nSVbf7ULz7mvAdMZ8l/gLwMmV\n6EdLPF9dT5YXHorFDG63qPOZLC07bMtKteNax1ghGT7L5u5UfoT8zVrKW4rb\nJdv0eppWOG8h/Tb+MQYBBh8uj07gTa1gd3dmO+iOLY9v6fpBFbXukCH2cr7w\nZMVk0Ey4tF1XPI1XmAclaRH9i/NE7crKOyFqZ3hzvEBTUFh4QJIFO5Dg3U1x\nYaZj9QsnQsq4h2LwEtqHhuSdTP7+lIX/fRnTi4B0wEkoxYTIAHn9KzFkG2oR\ncCdjMm9hhcGL1hi2hVlFuwaMmal0ghOf3NSS+OmyQ1Vnv0iHaEv+F5+SCTOY\nVhMcwy7xKonA1Nw3BhulztMPBfvJQDZnAXRFQbWZ7b2Sdlw/pMAGeBcWVAEe\nP3ZOLu2ceRAJhpMf+OBFncLuqZexMcf+oZm6ZpcYhO32oxAeYNvc8TLYQRwM\nHoehuLtgbI+YCWD38b9S99YXDpRkWxgfgLdi6ZVfkyM/H5XHMrQVYgl+ucaE\n5FjB\r\n=CwYN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4kw2HEjJpQjE3DOW4B7eUhP2HwDnaXeW9SuUykPZAqAiBfxHAC0wqax5vXR3pSrsTDkkUe5BAg6mwbI1sAiTUf1g=="}],"size":2555,"noattachment":false,"key":"/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz"},"maintainers":[{"name":"mdlavin","email":"matt.lavin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nested-error-stacks_2.1.0_1534166868709_0.9764420223448063"},"_hasShrinkwrap":false,"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":1534166868865,"_cnpm_publish_time":1534166868865,"dist-tags":{"latest":"2.1.1"}}