{"name":"clean-stack","version":"3.0.0","description":"Clean up error stack traces","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/clean-stack.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["clean","stack","trace","traces","error","electron"],"dependencies":{"escape-string-regexp":"4.0.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.32.0"},"browser":{"os":false},"gitHead":"1fe295bc61c7336c4e2aa797f139d646d811e4e9","bugs":{"url":"https://github.com/sindresorhus/clean-stack/issues"},"homepage":"https://github.com/sindresorhus/clean-stack#readme","_id":"clean-stack@3.0.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-RHxtgFvXsRQ+1AM7dlozLDY7ssmvUUh0XEnfnyhYgJTO6beNZHBogiaCwGM9Q3rFrUkYxOtsZRC0zAturg5bjg==","shasum":"a7c249369fcf0f33c7888c20ea3f3dc79620211f","tarball":"http://registry-npm.ywwl.com/clean-stack/download/clean-stack-3.0.0.tgz","fileCount":5,"unpackedSize":6357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5I3OCRA9TVsSAnZWagAAZSEQAIiQx1kBLbzE2r7HnUt+\n1hJ0L9BcQdAiqXl4nUeq2QgVt2RCrl6BCpQqeIylHbVquj3HeYV8tMhodIZR\nPAKLElCZfjZWf6S5Anj461GxhrRLPvp6oIr9SJL9TC/JrBW4CUI9NIwxrrd8\nc/r+dZVXvQ/pPrBETbuv5K4XJIxmp6vqWqS+2YBJxApbL09aNmo1ukLPvEFZ\n5BYy6VSEQ/Lf2OyFLjnRKIUxvRUOeMcXMM8TZBmTjKu81aKzEt/nC7QhxGCL\nCluIopEtLaTGACDjcWjipcMTJuCglC/KrldzoUBrzwJa7+5Zqeo+qRy02XhG\nhXBgU+L3JdAyySggKIzZ8k+Qtx8Bim2Vg83eMnoFPy/2xLjqAq3OQHewQwME\nARpYAtboA4BLcE83qMnBnkjGK229wU3KExoZ4G06gyRt/Y8HbPIt4jaueFOC\n47jCa81DueArWQc4jTBfrJ631q9E7noIbXKpQ0kTKxEWtfBpBS2dvVd9Fqq7\nfI7BCIY8Yl4CBU0/g43hEaXScBG5vfDTrRf+yMQvk821W2B3Z+doQT/0ugRX\nUulN6Hc5eJY358Y31EcaS+qBH+yviPa0lNbSjrX9SHVrYIYXn6i6yEp93DQe\n7DGjsHNE2pvaj6vMvN+1lhV+vd8gz1WlKh8UGhUVqpDHMwEGPV/8CmKawSB6\ngsrY\r\n=TkVO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9lmVlPtQSe0lwYr6JX8bQe+X4GknIE3W+I6x4ET6bewIgdKyhFqWGfCz4f0od/PrBKMWUBXta9V4fzCSAgIFIaAY="}],"size":2669,"noattachment":false,"key":"/clean-stack/-/clean-stack-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-stack_3.0.0_1592036814524_0.52605363544028"},"_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":1592036814636,"_cnpm_publish_time":1592036814636,"dist-tags":{"latest":"7.0.0"}}