{"id":20208391,"url":"https://github.com/fluture-js/fluenture","last_synced_at":"2025-07-22T19:33:52.622Z","repository":{"id":57239002,"uuid":"190720481","full_name":"fluture-js/fluenture","owner":"fluture-js","description":"Bring back Fluture's fluent method API","archived":false,"fork":false,"pushed_at":"2021-04-06T12:11:40.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T11:06:30.026Z","etag":null,"topics":["fluent","fluture"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/fluture-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-07T09:42:12.000Z","updated_at":"2022-09-18T18:30:27.000Z","dependencies_parsed_at":"2022-09-05T08:21:41.199Z","dependency_job_id":null,"html_url":"https://github.com/fluture-js/fluenture","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fluture-js/fluenture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluture-js%2Ffluenture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluture-js%2Ffluenture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluture-js%2Ffluenture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluture-js%2Ffluenture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluture-js","download_url":"https://codeload.github.com/fluture-js/fluenture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluture-js%2Ffluenture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266561336,"owners_count":23948627,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fluent","fluture"],"created_at":"2024-11-14T05:35:24.489Z","updated_at":"2025-07-22T19:33:52.583Z","avatar_url":"https://github.com/fluture-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fluenture\n\nBrings back [Fluture][]'s fluent method API, for the nostalgic developer.\n\n## Usage\n\n### Node\n\n```console\n$ npm install --save fluenture\n```\n\nOn Node 12 and up, this module can be loaded directly with `import` or\n`require`. On Node versions below 12, `require` or the [esm][]-loader can\nbe used.\n\n### Deno and Modern Browsers\n\nYou can load the EcmaScript module from various content delivery networks:\n\n- [Skypack](https://cdn.skypack.dev/fluenture@3.1.0)\n- [JSPM](https://jspm.dev/fluenture@3.1.0)\n- [jsDelivr](https://cdn.jsdelivr.net/npm/fluenture@3.1.0/+esm)\n\n### Old Browsers and Code Pens\n\nThere's a [UMD][] file included in the NPM package, also available via\njsDelivr: https://cdn.jsdelivr.net/npm/fluenture@3.1.0/dist/umd.js\n\nThis file adds `fluenture` to the global scope, or use CommonJS/AMD\nwhen available.\n\n### Usage Example\n\n```js\nimport {resolve, reject} from 'fluture';\nimport {fluent} from 'fluenture';\n\nfluent (resolve (42))\n.map (x =\u003e x / 2)\n.chain (x =\u003e reject (x + 21))\n.swap ()\n.fork (console.error, console.log)\n```\n\n## API\n\nWe're using the `Fluenture a b` type here to denote instances of Future\nthat were enhanced with a fluent method API. One can think of the\n`Fluenture` type as a *subtype* of `Future`: any instances of it are also\ninstances of `Future`.\n\n#### \u003ca name=\"fluent\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L137\"\u003e`fluent :: Future a b -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nEnhance a Future with the fluent method API.\n\nThis function is idempotent.\n\n#### \u003ca name=\"functional\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L151\"\u003e`functional :: Future a b -⁠\u003e Future a b`\u003c/a\u003e\n\nStrip a fluent Future (or \"Fluenture\") from its method API.\n\nThis function is idempotent.\n\n#### \u003ca name=\"pipe\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L176\"\u003e`pipe :: (Future a b -⁠\u003e c) -⁠\u003e c`\u003c/a\u003e\n\nThis function is equivalent to Fluture's built-in `pipe` function, with\nonce exception; If a Future is returned from the given function, it is\nautomatically wrapped using [`fluent`](#fluent), so as to keep the fluent\nmethod chain intact.\n\nFluent [`pipe`](https://github.com/fluture-js/Fluture#pipe).\n\n#### \u003ca name=\"alt\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L190\"\u003e`alt :: Fluenture a b ~\u003e Future a b -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nFluent [`alt`](https://github.com/fluture-js/Fluture#alt).\n\n#### \u003ca name=\"and\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L196\"\u003e`and :: Fluenture a b ~\u003e Future a b -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nFluent [`and`](https://github.com/fluture-js/Fluture#and).\n\n#### \u003ca name=\"ap\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L201\"\u003e`ap :: Fluenture a b ~\u003e Future a (b -⁠\u003e c) -⁠\u003e Fluenture a c`\u003c/a\u003e\n\nFluent [`ap`](https://github.com/fluture-js/Fluture#ap).\n\n#### \u003ca name=\"bichain\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L207\"\u003e`bichain :: Fluenture a b ~\u003e (a -⁠\u003e Fluenture a c, b -⁠\u003e Fluenture a c) -⁠\u003e Fluenture a c`\u003c/a\u003e\n\nFluent [`bichain`](https://github.com/fluture-js/Fluture#bichain).\n\n#### \u003ca name=\"bimap\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L212\"\u003e`bimap :: Fluenture a b ~\u003e (a -⁠\u003e c, b -⁠\u003e d) -⁠\u003e Fluenture c d`\u003c/a\u003e\n\nFluent [`bimap`](https://github.com/fluture-js/Fluture#bimap).\n\n#### \u003ca name=\"both\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L218\"\u003e`both :: Fluenture a b ~\u003e Future a c -⁠\u003e Fluenture a (Pair b c)`\u003c/a\u003e\n\nFluent [`both`](https://github.com/fluture-js/Fluture#both).\n\n#### \u003ca name=\"cache\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L223\"\u003e`cache :: Fluenture a b ~\u003e () -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nFluent [`cache`](https://github.com/fluture-js/Fluture#cache).\n\n#### \u003ca name=\"chain\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L228\"\u003e`chain :: Fluenture a b ~\u003e (b -⁠\u003e Fluenture a c) -⁠\u003e Fluenture a c`\u003c/a\u003e\n\nFluent [`chain`](https://github.com/fluture-js/Fluture#chain).\n\n#### \u003ca name=\"chainRej\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L234\"\u003e`chainRej :: Fluenture a b ~\u003e (a -⁠\u003e Fluenture c b) -⁠\u003e Fluenture c b`\u003c/a\u003e\n\nFluent [`chainRej`](https://github.com/fluture-js/Fluture#chainRej).\n\n#### \u003ca name=\"coalesce\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L239\"\u003e`coalesce :: Fluenture a b ~\u003e (a -⁠\u003e c, b -⁠\u003e c) -⁠\u003e Fluenture d c`\u003c/a\u003e\n\nFluent [`coalesce`](https://github.com/fluture-js/Fluture#coalesce).\n\n#### \u003ca name=\"lastly\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L244\"\u003e`lastly :: Fluenture a b ~\u003e Future a c -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nFluent [`lastly`](https://github.com/fluture-js/Fluture#lastly).\n\n#### \u003ca name=\"map\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L249\"\u003e`map :: Fluenture a b ~\u003e (b -⁠\u003e c) -⁠\u003e Fluenture a c`\u003c/a\u003e\n\nFluent [`map`](https://github.com/fluture-js/Fluture#map).\n\n#### \u003ca name=\"mapRej\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L255\"\u003e`mapRej :: Fluenture a b ~\u003e (a -⁠\u003e c) -⁠\u003e Fluenture c b`\u003c/a\u003e\n\nFluent [`mapRej`](https://github.com/fluture-js/Fluture#mapRej).\n\n#### \u003ca name=\"pap\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L260\"\u003e`pap :: Fluenture a b ~\u003e Fluenture a (b -⁠\u003e c) -⁠\u003e Fluenture a c`\u003c/a\u003e\n\nFluent [`pap`](https://github.com/fluture-js/Fluture/#pap).\n\n#### \u003ca name=\"race\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L265\"\u003e`race :: Fluenture a b ~\u003e Future a b -⁠\u003e Fluenture a b`\u003c/a\u003e\n\nFluent [`race`](https://github.com/fluture-js/Fluture#race).\n\n#### \u003ca name=\"swap\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L270\"\u003e`swap :: Fluenture a b ~\u003e () -⁠\u003e Fluenture b a`\u003c/a\u003e\n\nFluent [`swap`](https://github.com/fluture-js/Fluture#swap).\n\n#### \u003ca name=\"done\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L275\"\u003e`done :: Fluenture a b ~\u003e (b -⁠\u003e c) -⁠\u003e Cancel`\u003c/a\u003e\n\nFluent [`done`](https://github.com/fluture-js/Fluture#done).\n\n#### \u003ca name=\"fork\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L280\"\u003e`fork :: Fluenture a b ~\u003e (a -⁠\u003e c, b -⁠\u003e d) -⁠\u003e Cancel`\u003c/a\u003e\n\nFluent [`fork`](https://github.com/fluture-js/Fluture#fork).\n\n#### \u003ca name=\"forkCatch\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L285\"\u003e`forkCatch :: Fluenture a b ~\u003e (Error -⁠\u003e c, a -⁠\u003e d, b -⁠\u003e e) -⁠\u003e Cancel`\u003c/a\u003e\n\nFluent [`forkCatch`](https://github.com/fluture-js/Fluture#forkCatch).\n\n#### \u003ca name=\"promise\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L290\"\u003e`promise :: Fluenture Error a ~\u003e () -⁠\u003e Promise Error a`\u003c/a\u003e\n\nFluent [`promise`](https://github.com/fluture-js/Fluture#promise).\n\n#### \u003ca name=\"value\" href=\"https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L295\"\u003e`value :: Fluenture a b ~\u003e ((Nullable a, b) -⁠\u003e c) -⁠\u003e Cancel`\u003c/a\u003e\n\nFluent [`value`](https://github.com/fluture-js/Fluture#value).\n\n[Fluture]: https://github.com/fluture-js/Fluture\n[esm]: https://github.com/standard-things/esm\n[UMD]: https://github.com/umdjs/umd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluture-js%2Ffluenture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluture-js%2Ffluenture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluture-js%2Ffluenture/lists"}