{"name":"clean-stack","version":"1.2.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["clean","stack","trace","traces","error","err","electron"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"aefdc52b5d2f416ace014cbe53e70463e020c9da","bugs":{"url":"https://github.com/sindresorhus/clean-stack/issues"},"homepage":"https://github.com/sindresorhus/clean-stack#readme","_id":"clean-stack@1.2.0","_shasum":"a465128d62c31fb1a3606d00abfe59dcf652f568","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a465128d62c31fb1a3606d00abfe59dcf652f568","tarball":"http://registry-npm.ywwl.com/clean-stack/download/clean-stack-1.2.0.tgz","integrity":"sha512-tZyGj7qkS1sRwNE5s5Osx5Sc14TZgHf+Tei4/y3690zZ2SVpvFg01J6VCS+4n8xZSm0AxTkWw0dpkr/RhidDrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8D7LzMVe7c1AAfXDtH96QC0Sb8Zo/z9HEXfdGds8U5AiEAyFCg+IoEqmm1ld0uPki0YiS5PsbicL4pHbLNb30DKeM="}],"size":1983,"noattachment":false,"key":"/clean-stack/-/clean-stack-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/clean-stack-1.2.0.tgz_1494828504327_0.5275583770126104"},"directories":{},"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":1494828504571,"_cnpm_publish_time":1494828504571,"dist-tags":{"latest":"7.0.0"}}