{"id":16682573,"url":"https://github.com/jchip/error","last_synced_at":"2025-10-11T10:49:34.101Z","repository":{"id":57120648,"uuid":"398387312","full_name":"jchip/error","owner":"jchip","description":"utilities and polyfill for node.js errors","archived":false,"fork":false,"pushed_at":"2021-09-11T10:18:46.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T10:49:33.514Z","etag":null,"topics":["aggregateerror","clean","cleanerrorstack","error","stack"],"latest_commit_sha":null,"homepage":"https://jchip.github.io/error","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-20T19:59:28.000Z","updated_at":"2021-09-11T10:18:49.000Z","dependencies_parsed_at":"2022-08-24T06:50:12.488Z","dependency_job_id":null,"html_url":"https://github.com/jchip/error","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jchip/error","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Ferror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Ferror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Ferror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Ferror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchip","download_url":"https://codeload.github.com/jchip/error/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Ferror/sbom","scorecard":{"id":511353,"data":{"date":"2025-08-11","repo":{"name":"github.com/jchip/error","commit":"8c6fe7ca88458661eb94499ca63f8fcde4c3a365"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/jchip/error/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/jchip/error/node.js.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:28","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T00:37:23.198Z","repository_id":57120648,"created_at":"2025-08-20T00:37:23.198Z","updated_at":"2025-08-20T00:37:23.198Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006864,"owners_count":26084208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregateerror","clean","cleanerrorstack","error","stack"],"created_at":"2024-10-12T14:07:58.276Z","updated_at":"2025-10-11T10:49:34.084Z","avatar_url":"https://github.com/jchip.png","language":"TypeScript","readme":"# @jchip/error \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e \u003c!-- omit in toc --\u003e\n\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![build][build-image]][build-url]\n[![coverage][coverage-image]][coverage-url]\n\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nUtilities and polyfill for node.js errors\n\n### API reference: \u003chttps://jchip.github.io/error\u003e \u003c!-- omit in toc --\u003e\n\n# Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Examples](#examples)\n  - [`cleanErrorStack`](#cleanerrorstack)\n  - [`aggregateErrorStack`](#aggregateerrorstack)\n  - [`AggregateError`](#aggregateerror)\n\n## Examples\n\n### `cleanErrorStack`\n\n```ts\nimport { cleanErrorStack } from \"@jchip/error\";\n\ntry {\n  require(\"oops\");\n} catch (err) {\n  console.log(cleanErrorStack(err));\n}\n```\n\nOutput:\n\n```\nError: Cannot find module 'oops'\nRequire stack:\n- /Users/joel/error/test/samples.ts\n    at Object.\u003canonymous\u003e (test/samples.js:4:3)\n```\n\nvs:\n\n```\nError: Cannot find module 'oops'\nRequire stack:\n- /Users/joel/error/test/samples.js\n    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n    at Function.Module._load (node:internal/modules/cjs/loader:778:27)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at require (node:internal/modules/cjs/helpers:94:18)\n    at Object.\u003canonymous\u003e (/Users/joel/error/test/samples.js:4:3)\n    at Module._compile (node:internal/modules/cjs/loader:1101:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n```\n\n### `aggregateErrorStack`\n\nGenerate stack with aggregate errors from [AggregateError]\n\nExample:\n\n```ts\nimport { aggregateErrorStack, AggregateError } from \"@jchip/error\";\n\nconsole.log(aggregateErrorStack(new AggregateError([new Error(\"error 1\")], \"test\")));\n```\n\nOutput:\n\n```\nAggregateError: test\n    at Object.\u003canonymous\u003e (/Users/joel/error/test/samples.js:3:33)\n    at Module._compile (node:internal/modules/cjs/loader:1101:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n    at node:internal/main/run_main_module:17:47\n  Error: error 1\n      at Object.\u003canonymous\u003e (/Users/joel/error/test/samples.js:3:53)\n      at Module._compile (node:internal/modules/cjs/loader:1101:14)\n      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n      at Module.load (node:internal/modules/cjs/loader:981:32)\n      at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n      at node:internal/main/run_main_module:17:47\n```\n\n### `AggregateError`\n\n- Polyfill for [AggregateError]\n- node.js 15+ has built-in [AggregateError]\n\nExample with `cleanErrorStack`:\n\n```ts\nimport { cleanErrorStack, AggregateError } from \"@jchip/error\";\n\ntry {\n  require(\"bad\");\n} catch (err) {\n  console.log(cleanErrorStack(new AggregateError([err], \"require failed\")));\n}\n```\n\nOutput:\n\n```\nAggregateError: require failed\n    at Object.\u003canonymous\u003e (test/samples.js:12:31)\n  Error: Cannot find module 'bad'\n  Require stack:\n  - /Users/joel/error/test/samples.js\n      at Object.\u003canonymous\u003e (test/samples.js:10:3)\n```\n\nvs:\n\n```\nAggregateError: require failed\n    at Object.\u003canonymous\u003e (/Users/joel/error/test/samples.js:12:15)\n    at Module._compile (node:internal/modules/cjs/loader:1101:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n    at node:internal/main/run_main_module:17:47\n  Error: Cannot find module 'bad'\n  Require stack:\n  - /Users/joel/error/test/samples.js\n      at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n      at Function.Module._load (node:internal/modules/cjs/loader:778:27)\n      at Module.require (node:internal/modules/cjs/loader:1005:19)\n      at require (node:internal/modules/cjs/helpers:94:18)\n      at Object.\u003canonymous\u003e (/Users/joel/error/test/samples.js:10:3)\n      at Module._compile (node:internal/modules/cjs/loader:1101:14)\n      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n      at Module.load (node:internal/modules/cjs/loader:981:32)\n      at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n```\n\n[aggregateerror]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n[license-image]: https://img.shields.io/npm/l/@jchip/error.svg\n[license-url]: LICENSE\n[build-image]: https://github.com/jchip/error/actions/workflows/node.js.yml/badge.svg\n[build-url]: https://github.com/jchip/error/actions/workflows/node.js.yml\n[coverage-image]: https://coveralls.io/repos/github/jchip/error/badge.svg?branch=main\n[coverage-url]: https://coveralls.io/github/jchip/error?branch=main\n[downloads-image]: https://img.shields.io/npm/dm/@jchip/error.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=%40jchip%2Ferror\n[deps-svg]: https://david-dm.org/jchip/error.svg\n[deps-url]: https://david-dm.org/jchip/error\n[dev-deps-svg]: https://david-dm.org/jchip/error/dev-status.svg\n[dev-deps-url]: https://david-dm.org/jchip/error#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/@jchip/error.png?downloads=true\u0026stars=true\n[package-url]: https://npmjs.com/package/@jchip/error\n[npm-version-svg]: https://versionbadg.es/jchip/error.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Ferror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchip%2Ferror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Ferror/lists"}