{"id":15564122,"url":"https://github.com/dahlia/aitertools","last_synced_at":"2025-05-05T23:27:52.248Z","repository":{"id":62422732,"uuid":"495127418","full_name":"dahlia/aitertools","owner":"dahlia","description":"Well-tested utility functions dealing with async iterables","archived":false,"fork":false,"pushed_at":"2024-03-26T11:45:26.000Z","size":128,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-26T10:51:38.317Z","etag":null,"topics":["async-iterators","deno","itertools","typescript"],"latest_commit_sha":null,"homepage":"https://jsr.io/@hongminhee/aitertools","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dahlia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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,"publiccode":null,"codemeta":null}},"created_at":"2022-05-22T17:20:46.000Z","updated_at":"2025-02-24T01:46:53.000Z","dependencies_parsed_at":"2024-03-26T12:03:13.447Z","dependency_job_id":null,"html_url":"https://github.com/dahlia/aitertools","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Faitertools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Faitertools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Faitertools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Faitertools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dahlia","download_url":"https://codeload.github.com/dahlia/aitertools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252592269,"owners_count":21773230,"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":["async-iterators","deno","itertools","typescript"],"created_at":"2024-10-02T16:36:59.649Z","updated_at":"2025-05-05T23:27:52.226Z","avatar_url":"https://github.com/dahlia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- deno-fmt-ignore-file --\u003e\n\naitertools\n==========\n\n[![Published on JSR][JSR badge]][JSR]\n[![Published on npm][npm badge]][npm]\n[![LGPL 3.0][License badge]](./LICENSE)\n[![GitHub Actions][GitHub Actions status badge]][GitHub Actions]\n[![Codecov][Codecov badge]][Codecov]\n\nThis library provides a [well-tested][Codecov] collection of small utility\nfunctions dealing with [async iterables].  You can think of it as .NET LINQ or\nPython aitertools for [Deno] \u0026 Node.js.\n\n[JSR badge]: https://jsr.io/badges/@hongminhee/aitertools?\n[JSR]: https://jsr.io/@hongminhee/aitertools\n[npm badge]: https://img.shields.io/npm/v/aitertools\n[npm]: https://www.npmjs.com/package/aitertools\n[License badge]: https://img.shields.io/github/license/dahlia/aitertools\n[Deno Doc badge]: https://img.shields.io/badge/api-deno%20doc-blue\n[GitHub Actions]: https://github.com/dahlia/aitertools/actions/workflows/build.yaml\n[GitHub Actions status badge]: https://github.com/dahlia/aitertools/actions/workflows/build.yaml/badge.svg\n[Codecov badge]: https://codecov.io/gh/dahlia/aitertools/branch/main/graph/badge.svg?token=UBDX4Inrz6\n[Codecov]: https://codecov.io/gh/dahlia/aitertools\n[async iterables]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n[Deno]: https://deno.com/\n\n\nFunctions\n---------\n\nFor the complete list of functions, see the [complete API reference][JSR].\n\n -  `concat(...sources)`: Concatenate multiple async iterables into one.\n -  `take(source, count)`: Take the first `count` items from the `source`.\n -  `drop(source, count)`: Drop the first `count` items from the `source`.\n -  `takeWhile(source, predicate)`: Take items from the `source` while the\n    `predicate` returns `true`.\n -  `dropWhile(source, predicate)`: Drop items from the `source` while the\n    `predicate` returns `true`.\n -  `takeEnd(source, count)`: Take the last `count` items from the `source`.\n -  `dropEnd(source, count)`: Drop the last `count` items from the `source`.\n -  `map(mapper, ...sources)`: Apply the `mapper` to each item in the `sources`.\n -  `filter(predicate, ...sources)`: Filter items in the `sources` by the\n    `predicate`.\n -  `reduce(reducer, source, initial?)`: Reduce the `source` to a single value\n    by the `reducer`, optionally with the `initial` value.\n -  `tee(source, number)`: Effectively duplicate the `source` into `number`\n    of async iterables.\n -  `groupBy(source, keySelector)`: Group items in the `source` by the\n    `keySelector`.\n -  `unique(source, keySelector?)`: Eliminate duplicate items in the `source`,\n    optionally by the `keySelector`.\n -  `range(start?, stop, step?)`: Generate a sequence of numbers from `start`\n    to `stop` by `step`.\n -  `count(start?, step?)`: Generate a sequence of numbers from `start` by\n    `step` infinitely.\n -  `cycle(source)`: Cycle the `source` infinitely.\n -  `repeat(value, times?)`: Repeat the `value` for `times` times, or\n    infinitely if `times` is not specified.\n -  `fromIterable(source)`: Convert an iterable to an async iterable.\n -  `toArray(source)`: Convert an async iterable to an array.\n -  `toSet(source)`: Convert an async iterable to a `Set`.\n -  `toMap(source, keySelector, valueSelector?)`: Convert an async iterable to\n    a `Map`.\n -  `assertStreams(actual, expected, msg?)`: Asset that an async iterable\n    `actual` is equal to an array `expected`.\n -  `assertStreamStartsWith(actual, expected, msg?)`: Asset that an async\n    iterable `actual` (which is possibly infinite) starts with an array\n    `expected`.\n\n\nUsage\n-----\n\nIn Deno:\n\n~~~ console\n$ deno add @hongminhee/aitertools\n~~~\n\n~~~ typescript\nimport * as aitertools from \"@hongminhee/aitertools\";\n~~~\n\nIn Node.js:\n\n~~~ console\n$ npm add aitertools\n~~~\n\n~~~ typescript\nimport * as aitertools from \"aitertools\";\n~~~\n\n\nChangelog\n---------\n\nSee *[CHANGES.md](CHANGES.md)* file.  Note that unreleased versions are also\navailable on [JSR] for Deno:\n\n~~~ typescript\ndeno add @hongminhee/aitertools@0.6.0-dev.36+9aa783c\n~~~\n\n… and on [npm] with `dev` tag for Node.js:\n\n~~~ console\n$ npm add aitertools@dev\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Faitertools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdahlia%2Faitertools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Faitertools/lists"}