{"id":25826773,"url":"https://github.com/watchdg/node-result","last_synced_at":"2026-06-14T10:32:45.182Z","repository":{"id":57142273,"uuid":"275277791","full_name":"WatchDG/node-result","owner":"WatchDG","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-07T00:03:13.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T00:25:38.702Z","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/WatchDG.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-06-27T01:22:38.000Z","updated_at":"2021-12-03T08:51:44.000Z","dependencies_parsed_at":"2022-09-05T18:40:59.839Z","dependency_job_id":null,"html_url":"https://github.com/WatchDG/node-result","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WatchDG%2Fnode-result","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WatchDG%2Fnode-result/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WatchDG%2Fnode-result/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WatchDG%2Fnode-result/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WatchDG","download_url":"https://codeload.github.com/WatchDG/node-result/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241176617,"owners_count":19922732,"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","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":"2025-02-28T15:44:55.407Z","updated_at":"2025-11-24T10:02:02.085Z","avatar_url":"https://github.com/WatchDG.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-result\n\n## install\n\n```shell\nnpm install node-result\n# or\nyarn add node-result\n```\n\n## example\n\n```ts\nimport { ok, fail } from \"node-result\";\n\nasync function checker(data: any) {\n  try {\n    if (typeof data !== 'string') {\n      return fail(void 0);\n    }\n    return ok(null);\n  } catch (error) {\n    return fail(error);\n  }\n}\n\n(async () =\u003e {\n  (await checker('foo'));           // return Result\n  (await checker(5));               // return Result\n  (await checker('bar'));           // return Result\n\n  (await checker('foo')).unwrap();  // return null\n  (await checker(5)).unwrap();      // throw undefined\n  (await checker('bar')).unwrap();  // not done\n})();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatchdg%2Fnode-result","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatchdg%2Fnode-result","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatchdg%2Fnode-result/lists"}