{"id":16661055,"url":"https://github.com/agrafix/flow-sequence","last_synced_at":"2026-04-17T04:02:11.521Z","repository":{"id":66320061,"uuid":"138258609","full_name":"agrafix/flow-sequence","owner":"agrafix","description":"JavaScript: Efficient chaining of operations of array like structures","archived":false,"fork":false,"pushed_at":"2018-06-26T04:06:09.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T20:48:56.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/agrafix.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":"2018-06-22T05:30:44.000Z","updated_at":"2018-06-26T04:06:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"86c51a4d-c45a-4b71-8f1f-4e025815ea21","html_url":"https://github.com/agrafix/flow-sequence","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2Fflow-sequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2Fflow-sequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2Fflow-sequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2Fflow-sequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrafix","download_url":"https://codeload.github.com/agrafix/flow-sequence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243293766,"owners_count":20268139,"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-10-12T10:33:16.909Z","updated_at":"2025-12-29T04:08:30.281Z","avatar_url":"https://github.com/agrafix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flow-sequence\n\n[![CircleCI](https://circleci.com/gh/agrafix/flow-sequence.svg?style=svg)](https://circleci.com/gh/agrafix/flow-sequence) ![npm](https://img.shields.io/npm/dw/flow-sequence.svg)\n\nAn (experimental) attempt to allow chaining operations on `Array` without traversing the array\nmultiple times. In other words: A chain of actions on an array should always be `O(n)` where `n` is\nthe number of elements in the array.\n\nIn the given example all element should only be traversed once:\n\n```javascript\nimport {chain} from 'flow-sequence';\n\nconst op = chain()\n  .filter((x) =\u003e x \u003e 2)\n  .map((x) =\u003e x + 1)\n  .filter((x) =\u003e x \u003e 4)\n  .flatMap((x) =\u003e [x, x])\n  .optimize();\n\nconsole.log(op.run([1, 2, 3, 4, 5]));\n```\n\n## Install\n\nGet from npm via `npm install flow-sequence` or `yarn add flow-sequence`. Comes with flow types!\n\n## Benchmarks\n\n```\n10 elements, no early failing: naive chaining x 337,465 ops/sec ±0.59% (91 runs sampled)\n10 elements, no early failing: flow sequence chaining x 1,142,422 ops/sec ±2.46% (87 runs sampled)\n100 elements, no early failing: naive chaining x 24,835 ops/sec ±1.41% (83 runs sampled)\n100 elements, no early failing: flow sequence chaining x 132,714 ops/sec ±0.80% (86 runs sampled)\n10000 elements, no early failing: naive chaining x 7.71 ops/sec ±1.36% (23 runs sampled)\n10000 elements, no early failing: flow sequence chaining x 1,345 ops/sec ±0.77% (86 runs sampled)\n10000 elements, early failing: naive chaining x 7,931 ops/sec ±1.40% (86 runs sampled)\n10000 elements, early failing: flow sequence chaining x 5,594 ops/sec ±1.46% (85 runs sampled)\n10000 elements, midway failing: naive chaining x 2,019 ops/sec ±1.09% (88 runs sampled)\n10000 elements, midway failing: flow sequence chaining x 4,608 ops/sec ±1.29% (86 runs sampled)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrafix%2Fflow-sequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrafix%2Fflow-sequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrafix%2Fflow-sequence/lists"}