{"id":17125044,"url":"https://github.com/aarondill/never-throw","last_synced_at":"2026-04-29T08:03:21.754Z","repository":{"id":65796920,"uuid":"585238724","full_name":"aarondill/never-throw","owner":"aarondill","description":"Simplify error handling!","archived":false,"fork":false,"pushed_at":"2023-02-10T15:04:25.000Z","size":474,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T19:39:17.146Z","etag":null,"topics":["error","error-handling","javascript","js","neverthrow","ts","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@aarond309/never-throw","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aarondill.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License.txt","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":"2023-01-04T17:03:38.000Z","updated_at":"2024-09-07T12:16:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"76c62890-273a-4a68-aca1-809ed32d34a1","html_url":"https://github.com/aarondill/never-throw","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.05128205128205132,"last_synced_commit":"5398fceea7424adba00d62c800be2212ff3bfc18"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/aarondill/never-throw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarondill%2Fnever-throw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarondill%2Fnever-throw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarondill%2Fnever-throw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarondill%2Fnever-throw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aarondill","download_url":"https://codeload.github.com/aarondill/never-throw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarondill%2Fnever-throw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32416146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","error-handling","javascript","js","neverthrow","ts","typescript"],"created_at":"2024-10-14T18:43:59.997Z","updated_at":"2026-04-29T08:03:21.720Z","avatar_url":"https://github.com/aarondill.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neverThrow.js\n\nSimplify error handling!\n\n## Usage:\n\nimport the named functions\n(The neverThrow function can also be imported through the default import):\n\n```javascript\nimport { neverThrow, neverThrowAsync } from \"@aarondill/never-throw\";\n```\n\nCall `foo` with error handling\n\n```js\nconst result = neverThrow(foo);\n\n// Pass arguments to foo:\nconst result = neverThrow(foo, 1, 2, 3);\n\n// Using an async function:\nconst result = await neverThrowAsync(bar, 1, 2, 3);\n//                   ^ Returns a promise\n```\n\nReturns an object with 'return' or 'error' depending on if the function threw.\nExample output:\n\n```js\nconsole.log(neverThrow(x=\u003ex, \"Hello, world!\"));\n{\n    isErr: false,\n    return: \"Hello, world!\",\n    args: [\"Hello, world!\"],\n    function: x=\u003ex,\n}\n```\n\nIf an error is thrown:\n\n```js\n// Throws a string!!\nconsole.log(neverThrow(function(x){throw x}, \"Hello, world!\"));\n{\n    isErr: true,\n    err: Error(\"Hello, world!\"),\n    args: [\"Hello, world!\"],\n    function: function(x){throw x},\n}\n```\n\n## Notes:\n\n- If no value is returned, 'return' will be `undefined`\n- `function` is the same function as was passed in\n- Any non-error value thrown will be converted to an error by `Error(String(thrownError))`\n- No mutation will be done on any value passed in.\n\n## Typescript\n\n### Exported Types:\n\n- BaseReturn - The return value, without 'err' or 'success' properties\n- Err - The object return when an error is thrown\n- Success - The object returned when no error is thrown\n- AwaitedSuccess - Success returned from `neverThrowAsync`, equivalent to Success\n- AwaitedErr - Error returned from `neverThrowAsync`, equivalent to Err\n\n### Note:\n\n```typescript\nif (result.isErr === true) result is Success\nelse result is Err\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarondill%2Fnever-throw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faarondill%2Fnever-throw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarondill%2Fnever-throw/lists"}