{"id":26208378,"url":"https://github.com/web-pacotes/foundation-types","last_synced_at":"2025-12-24T21:51:45.885Z","repository":{"id":233111091,"uuid":"786058892","full_name":"web-pacotes/foundation-types","owner":"web-pacotes","description":"Curated package with types I believe all packages and apps need to promote safeness and reduced side effects.","archived":false,"fork":false,"pushed_at":"2024-05-21T16:02:16.000Z","size":281,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-07T15:50:52.452Z","etag":null,"topics":["functional-programming","monads","types","typesafe","typescript"],"latest_commit_sha":null,"homepage":"https://web-pacotes.github.io/foundation-types/","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/web-pacotes.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}},"created_at":"2024-04-13T09:51:11.000Z","updated_at":"2024-05-21T16:02:18.000Z","dependencies_parsed_at":"2024-04-14T00:28:47.010Z","dependency_job_id":"48bfe079-9ef6-4b64-96fd-a8c1a18b2ffd","html_url":"https://github.com/web-pacotes/foundation-types","commit_stats":null,"previous_names":["web-pacotes/foundation-types"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Ffoundation-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Ffoundation-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Ffoundation-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Ffoundation-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-pacotes","download_url":"https://codeload.github.com/web-pacotes/foundation-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243170440,"owners_count":20247758,"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":["functional-programming","monads","types","typesafe","typescript"],"created_at":"2025-03-12T06:28:36.115Z","updated_at":"2025-12-24T21:51:45.877Z","avatar_url":"https://github.com/web-pacotes.png","language":"TypeScript","readme":"# foundation-types\n\nCurated package with types I believe all packages and apps need to promote safeness and reduced side effects.\n\n![npm version](https://badgen.net/npm/v/@web-pacotes/foundation-types) ![npm total downloads](https://badgen.net/npm/dt/@web-pacotes/foundation-types) ![bundlephobia bundle size](https://badgen.net/bundlephobia/min/@web-pacotes/foundation-types)\n\n---\n\n## How to use\n\nThe following is an example how to use the `Either` monad type to eliminate exceptions thrown from a division operation:\n\n```typescript\nimport { fold, Left, Right } from './either';\n\nfunction div_numbers(x: number, y: number) {\n\tif (y === 0.0) {\n\t\treturn Left('cannot divide number by 0!');\n\t}\n\n\treturn Right(x / y);\n}\n\nconst computation = div_numbers(2, 0);\nfold(\n\tcomputation,\n\t(l) =\u003e console.error(l),\n\t(r) =\u003e console.info(`division = ${r}`)\n);\n```\n\n## Features\n\n- Option type (either a value is present or absent)\n- Either type (either a value or other value)\n- Lazy type (lazily computed value)\n- Error type (type safe errors)\n  - IO (Read/Write) error type\n  - Unknown error type\n  - Wrapping/Unwrapping typed error in internal errors\n  - Wrapper around try/catch to execute callbacks in a safe throwable environment\n\n### Upcoming features\n\nNew types come as I need them or as requested through an issue.\n\n---\n\n## Bugs and Contributions\n\nFound any bug (including typos) in the package? Do you have any suggestion\nor feature to include for future releases? Please create an issue via\nGitHub in order to track each contribution. Also, pull requests are very\nwelcome!\n\nTo contribute, start by setting up your local development environment. The [setup.md](setup.md) document will onboard\nyou on how to do so!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-pacotes%2Ffoundation-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-pacotes%2Ffoundation-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-pacotes%2Ffoundation-types/lists"}