{"name":"extract-stack","version":"3.0.0","description":"Extract the actual stack of an error","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/extract-stack.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["extract","stack","error","trace","traces","lines","parse","get"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"ab9513bf68a5c2a039b8bed5e34ab20fedee9661","bugs":{"url":"https://github.com/sindresorhus/extract-stack/issues"},"homepage":"https://github.com/sindresorhus/extract-stack#readme","_id":"extract-stack@3.0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-rtGtWp57VXNB2N3Xty4+vt7d30z3RpbNyG/kLd2Rf3dNmq/evhX+OGL9sJV/neNfH89C2TIFWz/oHfm/26eBhg==","shasum":"65e4aa7be30350558437f3818eba1cce39e364e6","tarball":"http://registry-npm.ywwl.com/extract-stack/download/extract-stack-3.0.0.tgz","fileCount":5,"unpackedSize":5462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbf+gCRA9TVsSAnZWagAAVlYQAIdyJmZnxOk1VXadg/30\nEIjmx7CQc14oztiU9EJR+yoib2cOMgFDL12YWVZToLzRk6Isn4VkdaX6Aj6R\nCInV9DQcn0YpdptfBTY86FEjjuvMmAkjkkOJcw1cGeVo21uaSeKeNVbG58b/\nLlj8YTP5ftRknUF+Qbzasw/Tm8Y0cc46a1Viuee1CUtSteWeDBJUNkFiYWUV\niQr2Yn+IT/ovQniCKvYdOetMkBJL/v83boeBHiUPl2DA54e92lC6tiE+uF48\nP+Uu0WXiiLDUmzXwISZllxF6XLZezFRjKUhDBiJ8XKiwc6QhoB26XbECxhQe\nEErHzqLn68IZc+0dJ0GRgf+pQ9QcDf21mwJZCSKfe9L1fI7dlp4JDzTN/uoJ\ntFJyKohBEfAunRD2cdhPysnKmch1L5zMruQewUbLQmjckUZx2DQDmxfZ/kgI\n+auxwRjCB8QQo3czY6L1GbIxkMlos0LvvZD+ToP3gc/xv5pYw+Lbonpjf17+\nq+daErbVLcvxaKxLHMAd7RS27WIlbk0KDVUHmKpAuEyvnBRpGeNnXMDfrGYI\nBHXaKjXsSAooLyhxgSQ1XuRiJC7q14zE4pTX1NsPbxKv4nLTEwauoWUKtygC\nxixbTYHiZ0qJyJEinb3b9Te7/4wgyNIPs5FhE4lritCbXIX9HQpNyi8GJWFp\nYf3F\r\n=p5s+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYYuUaM2awZZUWWg3vGCAz9ZdjWqdyU1zid9qQTkWV7wIgOR/B6mk5VMYGJ6EwIfpw1afkrS4FOKACQ90EGL5f0YI="}],"size":2043,"noattachment":false,"key":"/extract-stack/-/extract-stack-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-stack_3.0.0_1617821599882_0.21545080360983881"},"_hasShrinkwrap":false,"readme":"# extract-stack\n\n> Extract the actual stack of an error\n\n## Install\n\n```\n$ npm install extract-stack\n```\n\n## Usage\n\n```js\nimport extractStack from 'extract-stack';\n\nconst error = new Error('Missing unicorn');\n\nconsole.log(error.stack);\n/*\nError: Missing unicorn\n    at Object.<anonymous> (/Users/sindresorhus/dev/extract-stack/unicorn.js:2:15)\n    at Module._compile (module.js:409:26)\n    at Module.load (module.js:343:32)\n    at startup (node.js:139:18)\n*/\n\nconsole.log(extractStack(error));\n/*\n    at Object.<anonymous> (/Users/sindresorhus/dev/extract-stack/unicorn.js:2:15)\n    at Module._compile (module.js:409:26)\n    at Module.load (module.js:343:32)\n    at startup (node.js:139:18)\n*/\n\nconsole.log(extractStack.lines(error));\n/*\n[\n\t'Object.<anonymous> (/Users/sindresorhus/dev/extract-stack/unicorn.js:2:15)'\n\t'Module._compile (module.js:409:26)'\n\t'Module.load (module.js:343:32)'\n\t'startup (node.js:139:18)'\n]\n*/\n```\n\n## API\n\nIt gracefully handles cases where the stack is `undefined` or empty and returns an empty string.\n\n### extractStack(error)\n\nReturns the actual stack part of the error stack.\n\n### extractStack.lines(error)\n\nReturns the stack lines of the error stack without the noise as a `string[]`.\n\n#### error\n\nType: `Error | string | undefined`\n\nEither an `Error` or the `.stack` of an `Error`.\n\n## Related\n\n- [clean-stack](https://github.com/sindresorhus/clean-stack) - Clean up error stack traces\n","publish_time":1617821600063,"_cnpm_publish_time":1617821600063,"dist-tags":{"latest":"3.0.0"}}