{"id":20109805,"url":"https://github.com/hyper63/task","last_synced_at":"2025-10-07T11:47:53.645Z","repository":{"id":110719215,"uuid":"330282520","full_name":"hyper63/task","owner":"hyper63","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-09T20:08:13.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T05:41:38.716Z","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-17T00:06:46.000Z","updated_at":"2021-03-09T20:08:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a932eee-aca5-4be1-b7c0-50e1dfd4eeae","html_url":"https://github.com/hyper63/task","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Ftask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Ftask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Ftask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Ftask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyper63","download_url":"https://codeload.github.com/hyper63/task/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241550047,"owners_count":19980641,"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:30.477Z","updated_at":"2025-10-07T11:47:48.573Z","avatar_url":"https://github.com/hyper63.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003etask\u003c/h1\u003e\n\u003cp align=\"center\"\u003eTask is a ADT that can wrap async functions and make them execute in a lazy path. This allows for better error management and consistents results. You can use `fromPromise` and `fromNode` to wrap promises and callbacks then chain them together in a lazy pipeline that does not execute the async code until `fork` is applied.\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/hyper63/task/tags/\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/hyper63/task.svg?sort=semver\" alt=\"Current Version\" /\u003e\u003c/a\u003e\n  \u003cimg src=\"https://github.com/hyper63/task/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\nsee example.js\n\n```js\nimport { Task } from \"https://x.nest.land/task@1.0.4/mod.ts\";\nconst { fromPromise } = Task;\n\nfromPromise((x) =\u003e Promise.resolve(x + \" :tada:\"))(\"Hello\")\n  .fork(\n    (e) =\u003e console.log(\"promise was rejected\"),\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/task\n\ndeps.js\n\n```\nexport { Task } from 'https://x.nest.land/task@1.0.4/mod.js'\n```\n\n## Features\n\n- fromPromise\n- fromNode\n\n## methods\n\n- map - applys function to value\n- chain - applys function that retuns task\n- ap\n- concat - forks the passed in task then concats the task with the current one\n- fork - fork runs the task contained function\n- toPromise - forks the task and returns a promise\n\n## constructors\n\n- Task.of - creates a Task with a value eg. Task.of('foo')\n- Task.resolve - creates a Task with a value and puts Task in resolved state\n- Task.reject - creates a Task with a value in rejected state\n- Task.fromPromise - returns a constructor function that will create a Task\n- Task.fromNode - returns a constructor function that will create a Task\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%2Ftask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyper63%2Ftask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper63%2Ftask/lists"}