Gathering detailed insights and metrics for clean-stack
Gathering detailed insights and metrics for clean-stack
Gathering detailed insights and metrics for clean-stack
Gathering detailed insights and metrics for clean-stack
@esm2cjs/clean-stack
Clean up error stack traces. This is a fork of sindresorhus/clean-stack, but with CommonJS support.
modern-errors-clean
`modern-errors` plugin to clean stack traces
assert-kindof
Check native type of value and throw AssertionError if not okey. Clean stack traces. Simplicity. Built on [is-kindof][].
stack-utils
Captures and cleans stack traces
npm install clean-stack
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
337 Stars
53 Commits
29 Forks
8 Watching
1 Branches
13 Contributors
Updated on 27 Jul 2024
JavaScript (97.83%)
TypeScript (2.17%)
Cumulative downloads
Total Downloads
Last day
-0.7%
6,463,353
Compared to previous day
Last week
4.1%
34,668,539
Compared to previous week
Last month
15.9%
139,095,543
Compared to previous month
Last year
17.8%
1,411,148,779
Compared to previous year
1
Clean up error stack traces
Removes the mostly unhelpful internal Node.js entries.
Also works in Electron.
1npm install clean-stack
1import cleanStack from 'clean-stack'; 2 3const error = new Error('Missing unicorn'); 4 5console.log(error.stack); 6/* 7Error: Missing unicorn 8 at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) 9 at Module._compile (module.js:409:26) 10 at Object.Module._extensions..js (module.js:416:10) 11 at Module.load (module.js:343:32) 12 at Function.Module._load (module.js:300:12) 13 at Function.Module.runMain (module.js:441:10) 14 at startup (node.js:139:18) 15*/ 16 17console.log(cleanStack(error.stack)); 18/* 19Error: Missing unicorn 20 at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) 21*/
Returns the cleaned stack or undefined
if the given stack
is undefined
.
Type: string | undefined
The stack
property of an Error
.
Type: object
Type: boolean
Default: false
Prettify the file paths in the stack:
/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15
→ ~/dev/clean-stack/unicorn.js:2:15
Type: string?
Remove 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.
Example with '/Users/sindresorhus/dev/clean-stack'
as basePath
:
/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15
→ unicorn.js:2:15
Type: (path: string) => boolean
Remove the stack lines where the given function returns false
. The function receives the path part of the stack line.
1import cleanStack from 'clean-stack'; 2 3const error = new Error('Missing unicorn'); 4 5console.log(cleanStack(error.stack)); 6// Error: Missing unicorn 7// at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) 8// at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/omit-me.js:1:16) 9 10const pathFilter = path => !/omit-me/.test(path); 11 12console.log(cleanStack(error.stack, {pathFilter})); 13// Error: Missing unicorn 14// at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/30 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More