{"id":20129381,"url":"https://github.com/ryanmorr/blunder","last_synced_at":"2026-01-25T21:46:36.531Z","repository":{"id":70575039,"uuid":"325851542","full_name":"ryanmorr/blunder","owner":"ryanmorr","description":"A modern client-side JavaScript error handler","archived":false,"fork":false,"pushed_at":"2024-11-15T17:44:48.000Z","size":179,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T12:51:13.617Z","etag":null,"topics":["error-handling","error-monitoring","error-reporting","exceptions","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-31T18:10:23.000Z","updated_at":"2024-11-15T17:47:27.000Z","dependencies_parsed_at":"2024-11-13T20:35:32.872Z","dependency_job_id":"0c8d4d47-0506-4de0-aa4c-351a524be2fa","html_url":"https://github.com/ryanmorr/blunder","commit_stats":{"total_commits":49,"total_committers":1,"mean_commits":49.0,"dds":0.0,"last_synced_commit":"8765480ff5e6b3e3079ba55c1445be6420a0dda0"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ryanmorr/blunder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fblunder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fblunder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fblunder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fblunder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/blunder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fblunder/sbom","scorecard":{"id":792237,"data":{"date":"2025-08-11","repo":{"name":"github.com/ryanmorr/blunder","commit":"e7e697906abf9091d759c76f17ab41273f286156"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanmorr/blunder/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanmorr/blunder/node.js.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: UNLICENSE:0","Info: FSF or OSI recognized license: The Unlicense: UNLICENSE: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 'master'"],"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"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T07:53:18.263Z","repository_id":70575039,"created_at":"2025-08-23T07:53:18.264Z","updated_at":"2025-08-23T07:53:18.264Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28759429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["error-handling","error-monitoring","error-reporting","exceptions","javascript"],"created_at":"2024-11-13T20:34:01.403Z","updated_at":"2026-01-25T21:46:36.512Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blunder\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e A modern client-side JavaScript error handler\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/blunder/raw/master/dist/cjs/blunder.js), [ESM](https://github.com/ryanmorr/blunder/raw/master/dist/esm/blunder.js), [UMD](https://github.com/ryanmorr/blunder/raw/master/dist/umd/blunder.js) versions or install via NPM:\n\n```sh\nnpm install @ryanmorr/blunder\n```\n\n## Usage\n\nBlunder offers the ability to normalize, enhance, capture, and report JavaScript errors in the browser:\n\n```javascript\nimport { monitor, subscribe, dispatch } from '@ryanmorr/blunder';\n\n// Listen for global runtime errors\nmonitor();\n\n// Subscribe to be notified when an exception is dispatched\nsubscribe((exception) =\u003e {\n    // Log the exception to the server\n    navigator.sendBeacon('/path/to/error/logger', JSON.stringify(exception));\n});\n\n// Manually dispatch an exception\ndispatch('An error occurred!');\n```\n\n## API\n\n### `Exception(message?, options?)`\n\n`Exception` is a subclass of `Error` to help normalize and enhance error instances:\n\n```javascript\nimport { Exception } from '@ryanmorr/blunder';\n\n// Create an exception just like a regular error\nconst exception = new Exception('error message');\n\n// Normalizes the standard properties\nexception.name;\nexception.message;\nexception.stack;\n```\n\nAdd custom metadata as an optional second argument to help identify the error:\n\n```javascript\nconst exception = new Exception('error message', {\n    timestamp: Date.now(),\n    url: document.location.href,\n    userAgent: navigator.userAgent\n});\n\n// The metadata is stored within the `data` property\nexception.data.timestamp;\nexception.data.url;\nexception.data.userAgent;\n```\n\nSupports the `cause` property to facilitate error chaining:\n\n```javascript\ntry {\n    connect();\n} catch(error) {\n    throw new Exception('Connection failed', {cause: error});\n}\n```\n\nExtend `Exception` to create your own custom subclasses:\n\n```javascript\nclass APIException extends Exception {\n    constructor(code, options){\n        super('error code: ' + code, options);\n        this.code = code;\n    }\n}\n```\n\nIncludes a `toJSON` method that returns a key/value object representing all the properties of the exception. It will convert some non-JSON friendly values to friendly ones (such as functions) and will detect and avoid circular references:\n\n```javascript\nfunction trySomething() {\n    try {\n        throw new Exception('error message', {source: trySomething});\n    } catch(exception) {\n        const serialized = exception.toJSON();\n        serialized.data.source; //=\u003e \"[Function: trySomething]\"\n    }\n}\n```\n\nYou can override the `serializable` method in subclasses to customize how an instance is serialized:\n\n```javascript\nclass MyException extends Exception {\n    serializable() {\n        return `${this.name}: ${this.message}`;\n    }\n}\n\nconst exception = new MyException('An error occurred');\nJSON.stringify(exception); //=\u003e \"MyException: An error occurred\"\n```\n\n`Exception` also has a static `from` method that can be used to convert a value into an `Exception` instance:\n\n```javascript\n// Supports error messages as strings\nconst exception = Exception.from('error message');\n\n// Supports normal error instances (will copy standard properties)\nconst error = new Error();\nconst exception = Exception.from(error);\n\n// Supports creating instances of subclasses\nconst exception = CustomException.from('error message');\nexception instanceof CustomException; //=\u003e true\n```\n\n------\n\n### `subscribe(callback)`\n\nSubscribe a callback function to be invoked with an `Exception` instance when an error is dispatched, it returns an unsubscribe function:\n\n```javascript\nimport { subscribe } from '@ryanmorr/blunder';\n\nconst unsubscribe = subscribe((exception) =\u003e {\n    // An exception was dispatched\n});\n\n// Unsubscribe from future error notifications\nunsubscribe();\n```\n\n------\n\n### `dispatch(error, options?)`\n\nManually dispatch an `Exception` to the error subscribers and return the `Exception` instance:\n\n```javascript\nimport { dispatch } from '@ryanmorr/blunder';\n\n// Supports strings\nconst exception = dispatch('error message');\n\n// Supports normal error instances\ndispatch(new Error());\n\n// Supports custom metadata as an optional second argument\ndispatch('error message', {foo: 1, bar: 2});\n\n// Supports `cause` property\ntry {\n    trySomething();\n} catch(error) {\n    dispatch('error message', {cause: error});\n}\n```\n\n------\n\n### `monitor(config?)`\n\nEnable global error monitoring by listening for the `error`, `unhandledrejection`, and `rejectionhandled` events. You can customize which events to listen for by providing a configuration object. It returns a function to disable monitoring:\n\n```javascript\nimport { monitor } from '@ryanmorr/blunder';\n\n// Listen for all error events by default\nconst stop = monitor();\n\n// Disable error monitoring\nstop();\n\n// Optionally specify which events to listen for\nmonitor({\n    error: true,\n    unhandledrejection: true,\n    rejectionhandled: false\n});\n```\n\n------\n\n### `attempt(fn, options?)`\n\nInternally wraps a function in a try/catch block for easy error handling. If an error is raised, it is automatically converted to an `Exception` instance, dispatched to error subscribers, and then returned:\n\n```javascript\nimport { attempt } from '@ryanmorr/blunder';\n\nconst [result, exception] = attempt(() =\u003e {\n    throw new Error();\n});\n\n// If `exception` is defined, the attempt failed\nif (exception) {\n    console.error(exception);\n}\n\n// If `result` is defined, the attempt was successful\nif (result) {\n    console.log(result);\n}\n```\n\nSupports custom metadata as an optional second argument that will be added to the `Exception` instance if an error should arise:\n\n```javascript\nconst [result, exception] = attempt(callback, {\n    viewportWidth: window.innerWidth,\n    viewportHeight: window.innerHeight\n});\n```\n\nSupports async functionality via promises by utilizing async/await syntax:\n\n```javascript\n// Use promises directly\nconst [result, exception] = await attempt(fetch('/path/to/resource'));\n\n// Use a function that returns a promise\nconst [result, exception] = await attempt(() =\u003e fetch('/path/to/resource'));\n```\n\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/blunder\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/blunder?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/blunder/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/blunder/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/blunder?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fblunder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Fblunder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fblunder/lists"}