{"_id":"extract-stack","_rev":"241526","name":"extract-stack","description":"Extract the actual stack of an error","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T15:57:33.000Z","created":"2017-03-24T06:29:24.584Z","3.0.0":"2021-04-07T18:53:20.063Z","2.0.0":"2019-04-17T02:54:37.878Z","1.0.0":"2017-03-24T06:29:24.584Z"},"users":{"danielbayley":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/extract-stack.git"},"versions":{"3.0.0":{"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":{"shasum":"65e4aa7be30350558437f3818eba1cce39e364e6","size":2043,"noattachment":false,"key":"/extract-stack/-/extract-stack-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/extract-stack/download/extract-stack-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-stack_3.0.0_1617821599882_0.21545080360983881"},"_hasShrinkwrap":false,"publish_time":1617821600063,"_cnpm_publish_time":1617821600063},"2.0.0":{"name":"extract-stack","version":"2.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":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["extract","stack","error","trace","traces","lines","parse","get"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"2412745a333b33f7378c0ff8c8e8def29057303c","bugs":{"url":"https://github.com/sindresorhus/extract-stack/issues"},"homepage":"https://github.com/sindresorhus/extract-stack#readme","_id":"extract-stack@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"11367bc865bfcd9bc0db3123e5edb57786f11f9b","size":2088,"noattachment":false,"key":"/extract-stack/-/extract-stack-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/extract-stack/download/extract-stack-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-stack_2.0.0_1555469677776_0.5218337522801402"},"_hasShrinkwrap":false,"publish_time":1555469677878,"_cnpm_publish_time":1555469677878},"1.0.0":{"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","size":1877,"noattachment":false,"key":"/extract-stack/-/extract-stack-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/extract-stack/download/extract-stack-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/extract-stack-1.0.0.tgz_1490336962737_0.7901958215516061"},"directories":{},"publish_time":1490336964584,"_cnpm_publish_time":1490336964584,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/extract-stack#readme","bugs":{"url":"https://github.com/sindresorhus/extract-stack/issues"},"license":"MIT"}