{"name":"extract-stack","version":"1.0.0","description":"Extract the actual stack of an error","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/extract-stack.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["extract","stack","error","err","trace","traces","lines","parse","get"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"894f6562d1e52b8639201b7612d065b6c435dd70","bugs":{"url":"https://github.com/sindresorhus/extract-stack/issues"},"homepage":"https://github.com/sindresorhus/extract-stack#readme","_id":"extract-stack@1.0.0","_shasum":"b97acaf9441eea2332529624b732fc5a1c8165fa","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b97acaf9441eea2332529624b732fc5a1c8165fa","tarball":"http://registry-npm.ywwl.com/extract-stack/download/extract-stack-1.0.0.tgz","integrity":"sha512-M5Ge0JIrn12EtIVpje2G+hI5X78hmX4UDzynZ7Vnp1MiPSqleEonmgr2Rh59eygEEgq3YJ1GDP96rnM8tnVg/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcbI/YD/xv1mx2uvC9YH2XPkyGLt8i4Anxf+0ooWMIGgIgGRAHnBsErdCMoM/CDy4/krP4d97OwWb6ekdHakkJqoo="}],"size":1877,"noattachment":false,"key":"/extract-stack/-/extract-stack-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/extract-stack-1.0.0.tgz_1490336962737_0.7901958215516061"},"directories":{},"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":1490336964584,"_cnpm_publish_time":1490336964584,"dist-tags":{"latest":"3.0.0"}}