{"id":16720377,"url":"https://github.com/tomokimiyauci/result","last_synced_at":"2026-05-20T09:31:09.839Z","repository":{"id":60497734,"uuid":"543125179","full_name":"TomokiMiyauci/result","owner":"TomokiMiyauci","description":"Minimum result type port of Rust","archived":false,"fork":false,"pushed_at":"2023-07-07T07:29:34.000Z","size":60,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T14:58:28.921Z","etag":null,"topics":["container","err","error","match","ok","result","rust"],"latest_commit_sha":null,"homepage":"https://deno.land/x/result_js","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/TomokiMiyauci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-09-29T13:01:12.000Z","updated_at":"2024-01-28T06:57:41.000Z","dependencies_parsed_at":"2022-09-30T12:20:11.101Z","dependency_job_id":null,"html_url":"https://github.com/TomokiMiyauci/result","commit_stats":null,"previous_names":["tomokimiyauci/result-js"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fresult","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fresult/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fresult/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fresult/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomokiMiyauci","download_url":"https://codeload.github.com/TomokiMiyauci/result/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725527,"owners_count":20337666,"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":["container","err","error","match","ok","result","rust"],"created_at":"2024-10-12T22:06:54.453Z","updated_at":"2026-05-20T09:31:09.762Z","avatar_url":"https://github.com/TomokiMiyauci.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# result\n\n[![deno land](http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno)](https://deno.land/x/result_js)\n[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/result_js?doc)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/TomokiMiyauci/result)](https://github.com/TomokiMiyauci/result/releases)\n[![codecov](https://codecov.io/github/TomokiMiyauci/result/branch/main/graph/badge.svg)](https://codecov.io/github/TomokiMiyauci/result)\n[![GitHub](https://img.shields.io/github/license/TomokiMiyauci/result)](LICENSE)\n\n[![test](https://github.com/TomokiMiyauci/result/actions/workflows/test.yaml/badge.svg)](https://github.com/TomokiMiyauci/result/actions/workflows/test.yaml)\n[![NPM](https://nodei.co/npm/@miyauci/result.png?mini=true)](https://nodei.co/npm/@miyauci/result/)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\nMinimum result type port of Rust.\n\n[Option](https://github.com/TomokiMiyauci/option) version.\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Acknowledgements](#acknowledgements)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\ndeno.land:\n\n```ts\nimport * as mod from \"https://deno.land/x/result_js/mod.ts\";\n```\n\nnpm:\n\n```bash\nnpm i @miyauci/result\n```\n\n## Usage\n\nType [Result](https://deno.land/x/result_js/mod.ts?s=Result) represents an\nsuccess or failure.\n\n```ts\nimport {\n  Err,\n  Ok,\n  type Result,\n  unwrap,\n} from \"https://deno.land/x/result_js/mod.ts\";\nimport { assertThrows } from \"https://deno.land/std/testing/asserts.ts\";\n\nfunction divide(\n  numerator: number,\n  denominator: number,\n): Result\u003cnumber, string\u003e {\n  if (!denominator) return Err(\"divide by 0\");\n\n  return Ok(numerator / denominator);\n}\n\nconst opt = divide(100, 0);\nassertThrows(() =\u003e unwrap(opt));\n```\n\nAll [operators](https://deno.land/x/result_js/mod.ts#Functions) for\n[Result](https://deno.land/x/result_js/mod.ts?s=Result) are separated from\nprototype.\n\n## API\n\nAll APIs can be found in the [deno doc](https://deno.land/x/result_js?doc).\n\n## Acknowledgements\n\n- [Rust std::result](https://doc.rust-lang.org/std/result/index.html)\n\n## Contributing\n\nSee [contribution](CONTRIBUTING.md).\n\n## License\n\n[MIT](LICENSE) © 2023 Tomoki Miyauchi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fresult","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomokimiyauci%2Fresult","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fresult/lists"}