{"name":"nested-error-stacks","version":"2.1.1","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","scripts":{"test":"if node --version | grep -vE '^v(0|3|4|5|6|7)\\.' > /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":"^6.6.0","mocha":"^3.1.2","uuid":"^2.0.3"},"gitHead":"4f4c091fe51c002c4b8bb1a8ee11702e50e26d8a","homepage":"https://github.com/mdlavin/nested-error-stacks#readme","_id":"nested-error-stacks@2.1.1","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==","shasum":"26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5","tarball":"http://registry-npm.ywwl.com/nested-error-stacks/download/nested-error-stacks-2.1.1.tgz","fileCount":5,"unpackedSize":5396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQhjgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbZA/+KdPNjvhTmJPtlvio5X15ThL4LOSAxo0w+5+Hj2Gwr6eoNGD1\r\n8DcMRMh6pj0orKHqqz1f/NOnszc5CBj5h1YuvsoeIYvz6/INYPTHTlZ6D8zR\r\nGHa9bp28tU9D0vCaGxRA9luXHa2tDpffCsyoqGN9fqyJ8TR/kkRARgGFRM0a\r\n/hz4TjkfymO5wVrYWZFjLTaq//DA39k3+s3v6aiSXSNOPpSA0YmldN7/ZVPY\r\naxBgAi62LvHUtWidMtBxIzsUFRC+xW6Fhopfla4qnbqq6+I5t7gKvSlrfZCL\r\nNqLr/IGU6W5E1RUDIULo4okRm+zTRkvCUDbO5oHUkCo6EO/7MK2diPo0/JSJ\r\n+aOXCeM0+5lnd2txuKTNNPpo4NSYp0IH486TaPgx/lEnLIEOS5+AFtoeKFte\r\n7s4IPt7CkU1x0UeHD0tu4lgsHDsA0bN4BvELLmO5UZ9HotC8MvHKMVGpwSv3\r\nxSreWHh7tSvaiHvUNFl90ITnp9gNBKNVe9FTSa++b8CUa7BMVEGi6jjkp7w/\r\n+1u6+MasMt+1zkTXEDdqyO4K3gJwbnaHKRvATWPkgCuartiGqoEMpxqsC/cb\r\nrr+kfDgXh6FzIfeAX+DGLBSQeieZ3K6pvshtgjRgxBLFOzuKweGminb4HE+q\r\n8n12pUuxHkfMd+LIkG6GysGpAy0ZGnkcTaQ=\r\n=y2wJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFltAbsbFw9MeK1aOxhJ4+VxwDJFa3k5SlHjkRmobWK0AiEAlukB0pog82e0TuuZo/FsisEKl/DkmfY4L02X8MeKh98="}],"size":2554,"noattachment":false,"key":"/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz"},"_npmUser":{"name":"mdlavin","email":"matt.lavin@gmail.com"},"directories":{},"maintainers":[{"name":"mdlavin","email":"matt.lavin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nested-error-stacks_2.1.1_1648498912667_0.4297201029683799"},"_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":1648498912802,"_cnpm_publish_time":1648498912802,"dist-tags":{"latest":"2.1.1"}}