{"id":20109874,"url":"https://github.com/hyper63/either","last_synced_at":"2025-03-02T18:25:01.914Z","repository":{"id":110718884,"uuid":"330251153","full_name":"hyper63/either","owner":"hyper63","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-18T19:07:42.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T05:41:42.741Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyper63.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-01-16T20:34:27.000Z","updated_at":"2023-07-16T18:55:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"16fa21be-8ed3-419c-95cc-067a3cda8e2f","html_url":"https://github.com/hyper63/either","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Feither","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Feither/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Feither/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Feither/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyper63","download_url":"https://codeload.github.com/hyper63/either/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241550112,"owners_count":19980649,"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-13T18:09:43.325Z","updated_at":"2025-03-02T18:25:01.904Z","avatar_url":"https://github.com/hyper63.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003eeither\u003c/h1\u003e\n\u003cp align=\"center\"\u003eEither is a ADT that can return one of two types a left or right. Useful for error handling, specifically handling nulls and exceptions in your pure application workflow.\u003c/p\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/hyper63/either/tags/\"\u003e\u003cimg src=\"https://img.shields.io/github/tag/hyper63/either\" alt=\"Current Version\" /\u003e\u003c/a\u003e\n  \u003cimg src=\"https://github.com/hyper63/either/workflows/.github/workflows/deno.yml/badge.svg\" /\u003e\n\n\u003c/p\u003e\n\n---\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Installation](#installation)\n- [Features](#features)\n- [Methods](#methods)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Getting Started\n\n```js\nimport { Either } from \"https://x.nest.land/either/@1.0.6/mod.ts\";\nconst { fromNullable } = Either;\n\nfromNullable(null)\n  .fold(\n    (e) =\u003e console.log(\"Is Null\"),\n    (r) =\u003e console.log(r),\n  );\n```\n\n## Installation\n\nThis is a Deno module available to import from https://nest.land/package/either\n\ndeps.js\n\n```\nexport { Either } from 'https://x.nest.land/either@1.0.6/mod.ts'\n```\n\n## Features\n\n- fromNullable - `fromNullable(x).fold(console.error, console.log)`\n- tryCatch - `tryCatch(doFn).fold(console.error, console.log)`\n\n## Methods\n\n- of - Returns an Either as a Right\n- fromNullable - takes a value and if the value is null returns a Left and if\n  the value is not null returns a Right\n- tryCatch - takes a function that is invoked and if an exception is thrown it\n  returns a Left with the Error as the value, otherwise it returns a Right.\n\n## Contributing\n\nPull Requests are welcome\n\n## License\n\nMIT\n\n## Acknowledgements\n\nThe core code for this library was initiated from code shared by Brian Londorf\nin a course from frontend masters. If you want to learn more about functional\nprogramming in javascript check it out:\nhttps://frontendmasters.com/courses/hardcore-js-v2/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper63%2Feither","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyper63%2Feither","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper63%2Feither/lists"}