{"id":16158136,"url":"https://github.com/typeofweb/safe-try","last_synced_at":"2025-09-12T20:32:17.784Z","repository":{"id":253512590,"uuid":"843742207","full_name":"typeofweb/safe-try","owner":"typeofweb","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-17T09:54:50.000Z","size":56,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T17:47:10.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/typeofweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-08-17T09:27:08.000Z","updated_at":"2024-11-03T02:09:44.000Z","dependencies_parsed_at":"2024-08-17T10:21:00.933Z","dependency_job_id":null,"html_url":"https://github.com/typeofweb/safe-try","commit_stats":null,"previous_names":["typeofweb/safe-try","typeofweb/try_"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/typeofweb/safe-try","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb%2Fsafe-try","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb%2Fsafe-try/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb%2Fsafe-try/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb%2Fsafe-try/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typeofweb","download_url":"https://codeload.github.com/typeofweb/safe-try/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb%2Fsafe-try/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873290,"owners_count":25365823,"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-09-12T02:00:09.324Z","response_time":60,"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":[],"created_at":"2024-10-10T01:53:00.383Z","updated_at":"2025-09-12T20:32:17.500Z","avatar_url":"https://github.com/typeofweb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `safe-try`\n\nWant this?\n\n```ts\nconst [result, error] = try await asyncMightFail();\n```\n\nDo this!\n\n```ts\nconst [result, error] = await try_(asyncMightFail());\n```\n\nInspired by Matt Pocock's [tweet](https://x.com/mattpocockuk/status/1823822755562967230):\n\n![tweet-1823822755562967230](https://github.com/user-attachments/assets/3902fc31-123f-46ff-9da9-847a9ceb942c)\n\n\n## Usage\n\n```ts\nimport { try_ } from \"safe-try\";\nconst [result, error] = await try_(asyncMightFail());\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeofweb%2Fsafe-try","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypeofweb%2Fsafe-try","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeofweb%2Fsafe-try/lists"}