{"id":21561759,"url":"https://github.com/synonymdev/result","last_synced_at":"2025-03-18T04:47:09.726Z","repository":{"id":250053547,"uuid":"520571689","full_name":"synonymdev/result","owner":"synonymdev","description":"Result helper class","archived":false,"fork":false,"pushed_at":"2023-07-27T10:02:32.000Z","size":65,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T02:24:31.129Z","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/synonymdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-02T16:28:28.000Z","updated_at":"2024-07-24T19:44:23.000Z","dependencies_parsed_at":"2024-07-24T23:38:20.761Z","dependency_job_id":null,"html_url":"https://github.com/synonymdev/result","commit_stats":null,"previous_names":["synonymdev/result"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Fresult","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Fresult/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Fresult/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Fresult/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synonymdev","download_url":"https://codeload.github.com/synonymdev/result/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244159990,"owners_count":20408019,"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":"2024-11-24T09:27:54.042Z","updated_at":"2025-03-18T04:47:09.708Z","avatar_url":"https://github.com/synonymdev.png","language":"TypeScript","readme":"# Result helper class\n\n### Description\nResult helper class\n\n## Getting started\n\n```bash\nyarn add @synonymdev/result\n#or\nnpm i -s @synonymdev/result\n````\n\n## Usage\n```javascript\nimport { ok, err } from '@synonymdev/result';\n```\n\n```typescript\nconst func = (): Result\u003cnumber\u003e =\u003e {\n  return ok(42);\n  // OR\n  return err('error message');\n  // OR\n  return err(new Error('error message'));\n}\n\nconst result = func();\n\nif (result.isOk()) {\n    console.log(result.value); //42\n}\n\nif (result.isErr()) {\n    console.error(result.error.message); // \"error message\"\n}\n```\n\n\n## Development\n\n### `yarn build`\n\nBuilds library ready for production use.\n\n### `yarn test`\n\nUnit tests.\n\n### `yarn format`\n\nCode formatting.\n\n### `yarn lint`\n\nCode linting.\n\n### `yarn prepublish`\n\nPrepares code for publishing by building and bumping package version.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Fresult","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynonymdev%2Fresult","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Fresult/lists"}