{"name":"clean-stack","version":"2.0.0","description":"Clean up error stack traces","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/clean-stack.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["clean","stack","trace","traces","error","err","electron"],"devDependencies":{"ava":"^0.25.0","xo":"^0.23.0"},"gitHead":"8ca13453d8cff0c03359e0b8f6dccaf30ddab98c","bugs":{"url":"https://github.com/sindresorhus/clean-stack/issues"},"homepage":"https://github.com/sindresorhus/clean-stack#readme","_id":"clean-stack@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-VEoL9Qh7I8s8iHnV53DaeWSt8NJ0g3khMfK6NiCPB7H657juhro+cSw2O88uo3bo0c0X5usamtXk0/Of0wXa5A==","shasum":"301bfa9e8dd2d3d984c0e542f7aa67b996f63e0a","tarball":"http://registry-npm.ywwl.com/clean-stack/download/clean-stack-2.0.0.tgz","fileCount":4,"unpackedSize":4213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxilaCRA9TVsSAnZWagAAsaQP/1xLebCfcYeMagqj24a3\n9bxb7SKbFJK5rRbREijha02Fjx3KnbBYsQqf8/XMEIILqbrrpnMHNn9/YeqP\n6iEtaUWjxgtirGFbkirfk8BdpKmyi+xzco+HkDAibTh2tAsbp53Mr5x+Pxsi\nHiNXvP68QJSPrDVk75cDIA1lB5BSkmzlo0uaM4pyXiohUUtcq4MwmeAlSpJ4\nEi0nUKEX1FINS4htQoxWM4C20m156+mwolU51YtN1i2PcL+TY3LNYGIZ5H1w\nIhQZSgMOmTa5tijgJVVfH1yRezCwex8KY2X+4uQc6MXeLD86yriStuFZlvAA\n834wV2Eai9a/WAuiOEI3rjeTAW7cwqLu1RKDJQK+sYOV5JYxfX+1LaNTHVto\nahBuY1WwUvrEK6nFlZCn/OYGwaqG7KMsYsqTB5Dm2To6a2wOhF5gwmAFknIW\n+K1OAgXLrLZI7LLdZzs1WAntRtTo1KeQuko0ZBnihAO/V8+r4V8P2HeRwABu\nT5dM+Cyg/IYp5ii+LZDfC5MwvPo2vbjdl7L2btZuaAjbkbD8ZPxVmizXGTF0\nQIcXeRmnmyPyvUThwEkra4ajUeyBcmj5f2x4QgKmSdHJVDsC+QJTMleIIU0E\nmY/NefTo0MNn4C8DNvTVsji6KaZEcb2Dl38JVgM3xB3xNYmIoJq8aE3FLQfC\nJ85x\r\n=NS6i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKYQ28qwulRhxkiU5YHb9gJ2NN6CF+4zmaajwP4ONqyAiBkQV/zOXnV1eheXeP6zMX2SKPO552wp7qQeJW6ibN/Ig=="}],"size":2191,"noattachment":false,"key":"/clean-stack/-/clean-stack-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-stack_2.0.0_1539713368642_0.2756879508188137"},"_hasShrinkwrap":false,"readme":"# clean-stack\n\n> Clean up error stack traces\n\nRemoves the mostly unhelpful internal Node.js entries.\n\nAlso works in Electron.\n\n## Install\n\n```sh\nnpm install clean-stack\n```\n\n## Usage\n\n```js\nimport cleanStack from 'clean-stack';\n\nconst error = new Error('Missing unicorn');\n\nconsole.log(error.stack);\n/*\nError: Missing unicorn\n    at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)\n    at Module._compile (module.js:409:26)\n    at Object.Module._extensions..js (module.js:416:10)\n    at Module.load (module.js:343:32)\n    at Function.Module._load (module.js:300:12)\n    at Function.Module.runMain (module.js:441:10)\n    at startup (node.js:139:18)\n*/\n\nconsole.log(cleanStack(error.stack));\n/*\nError: Missing unicorn\n    at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)\n*/\n```\n\n## API\n\n### cleanStack(stack, options?)\n\nReturns the cleaned stack or `undefined` if the given `stack` is `undefined`.\n\n#### stack\n\nType: `string | undefined`\n\nThe `stack` property of an [`Error`](https://github.com/microsoft/TypeScript/blob/eac073894b172ec719ca7f28b0b94fc6e6e7d4cf/lib/lib.es5.d.ts#L972-L976).\n\n#### options\n\nType: `object`\n\n##### pretty\n\nType: `boolean`\\\nDefault: `false`\n\nPrettify the file paths in the stack:\n\n`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15`\n\n##### basePath\n\nType: `string?`\n\nRemove the given base path from stack trace file paths, effectively turning absolute paths into relative ones. It will also transform absolute file URLs into relative paths.\n\nExample with `'/Users/sindresorhus/dev/clean-stack'` as `basePath`:\n\n`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `unicorn.js:2:15`\n\n##### pathFilter\n\nType: `(path: string) => boolean`\n\nRemove the stack lines where the given function returns `false`. The function receives the path part of the stack line.\n\n```js\nimport cleanStack from 'clean-stack';\n\nconst error = new Error('Missing unicorn');\n\nconsole.log(cleanStack(error.stack));\n// Error: Missing unicorn\n//     at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)\n//     at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/omit-me.js:1:16)\n\nconst pathFilter = path => !/omit-me/.test(path);\n\nconsole.log(cleanStack(error.stack, {pathFilter}));\n// Error: Missing unicorn\n//     at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)\n```\n\n## Related\n\n- [extract-stack](https://github.com/sindresorhus/extract-stack) - Extract the actual stack of an error\n- [stack-utils](https://github.com/tapjs/stack-utils) - Captures and cleans stack traces\n","publish_time":1539713369173,"_cnpm_publish_time":1539713369173,"dist-tags":{"latest":"7.0.0"}}