{"id":16826937,"url":"https://github.com/wojtekmaj/async-array-utils","last_synced_at":"2025-07-31T22:13:11.708Z","repository":{"id":57169514,"uuid":"261007783","full_name":"wojtekmaj/async-array-utils","owner":"wojtekmaj","description":"A collection of array-related async utilities.","archived":false,"fork":false,"pushed_at":"2025-03-06T21:29:02.000Z","size":3610,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T22:27:01.088Z","etag":null,"topics":["array","array-methods","async","promise","utils"],"latest_commit_sha":null,"homepage":"","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/wojtekmaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"wojtekmaj"}},"created_at":"2020-05-03T19:43:52.000Z","updated_at":"2025-03-06T21:29:05.000Z","dependencies_parsed_at":"2023-09-24T21:51:45.238Z","dependency_job_id":"fbb44ce8-aabb-4623-bf77-605bf5db06c7","html_url":"https://github.com/wojtekmaj/async-array-utils","commit_stats":{"total_commits":219,"total_committers":2,"mean_commits":109.5,"dds":0.0547945205479452,"last_synced_commit":"6c43c1cc78e99d7e55f5f0f3db7ad4a8549e39bd"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fasync-array-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fasync-array-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fasync-array-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fasync-array-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wojtekmaj","download_url":"https://codeload.github.com/wojtekmaj/async-array-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841210,"owners_count":20356443,"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":["array","array-methods","async","promise","utils"],"created_at":"2024-10-13T11:19:10.518Z","updated_at":"2025-03-17T04:31:32.144Z","avatar_url":"https://github.com/wojtekmaj.png","language":"TypeScript","funding_links":["https://github.com/sponsors/wojtekmaj"],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/@wojtekmaj/async-array-utils.svg)](https://www.npmjs.com/package/@wojtekmaj/async-array-utils) ![downloads](https://img.shields.io/npm/dt/@wojtekmaj/async-array-utils.svg) [![CI](https://github.com/wojtekmaj/async-array-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/wojtekmaj/async-array-utils/actions)\n\n# Async-Array-Utils\n\nA collection of array-related async utilities.\n\n## tl;dr\n\n- Install by executing `npm install @wojtekmaj/async-array-utils` or `yarn add @wojtekmaj/async-array-utils`.\n- Import by adding `import * as asyncArrayUtils from '@wojtekmaj/async-array-utils'`.\n- Do stuff with it!\n  ```ts\n  const asyncMappedArr = await asyncMap([1, 2, 3], async (x) =\u003e x * 2);\n  ```\n\n## User guide\n\n### Table of contents\n\n- [`asyncEvery()`](#asyncEvery)\n- [`asyncEveryStrict()`](#asyncEveryStrict)\n- [`asyncFilter()`](#asyncFilter)\n- [`asyncFilterStrict()`](#asyncFilterStrict)\n- [`asyncFind()`](#asyncFind)\n- [`asyncFindIndex()`](#asyncFindIndex)\n- [`asyncForEach()`](#asyncForEach)\n- [`asyncForEachStrict()`](#asyncForEachStrict)\n- [`asyncMap()`](#asyncMap)\n- [`asyncMapStrict()`](#asyncMapStrict)\n- [`asyncReduce()`](#asyncReduce)\n- [`asyncSome()`](#asyncSome)\n- [`asyncSomeStrict()`](#asyncSomeStrict)\n\n### `asyncEvery()`\n\nTests whether all elements in the array pass the test implemented by the provided asynchronous function. It returns a Boolean value.\n\nNote: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider `asyncEveryStrict()` instead.\n\n#### Sample usage\n\n```ts\nimport { asyncEvery } from '@wojtekmaj/async-array-utils';\n\nconst largerThanZero = await asyncEvery([1, 2, 3], async (el) =\u003e el \u003e 0); // true\n```\n\n### `asyncEveryStrict()`\n\nLike `asyncEvery()`, but runs iterations non-concurrently.\n\n#### Sample usage\n\n```ts\nimport { asyncEveryStrict } from '@wojtekmaj/async-array-utils';\n\nconst indexes = [];\nconst largerThanZero = await asyncEveryStrict([1, 2, 3], async (el, index) =\u003e {\n  indexes.push(index);\n  return el \u003e 0;\n}); // true\nconsole.log(indexes); // [0, 1, 2]\n```\n\n### `asyncFilter()`\n\nCreates a new array with all elements that pass the test implemented by the provided asynchronous function.\n\nNote: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider `asyncFilterStrict()` instead.\n\n#### Sample usage\n\n```ts\nimport { asyncFilter } from '@wojtekmaj/async-array-utils';\n\nconst asyncFilteredArr = await asyncFilter([1, 2, 3], async (el) =\u003e el \u003e 1); // [2, 3]\n```\n\n### `asyncFilterStrict()`\n\nLike `asyncFilter()`, but runs iterations non-concurrently.\n\n#### Sample usage\n\n```ts\nimport { asyncFilterStrict } from '@wojtekmaj/async-array-utils';\n\nconst indexes = [];\nconst asyncFilteredArr = await asyncFilterStrict([1, 2, 3], async (el, index) =\u003e {\n  indexes.push(index);\n  return el \u003e 1;\n}); // [2, 3]\nconsole.log(indexes); // [0, 1, 2]\n```\n\n### `asyncFind()`\n\nReturns the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, `undefined` is returned.\n\n#### Sample usage\n\n```ts\nimport { asyncFind } from '@wojtekmaj/async-array-utils';\n\nconst asyncFoundEl = await asyncFind([1, 2, 3], async (el) =\u003e el \u003e 1); // 2\n```\n\n### `asyncFindIndex()`\n\nReturns the index of the first element in an array that satisfies the provided testing function. If no elements satisfy the testing function, `-1` is returned.\n\n#### Sample usage\n\n```ts\nimport { asyncFindIndex } from '@wojtekmaj/async-array-utils';\n\nconst asyncFoundIndex = await asyncFindIndex([1, 2, 3], async (el) =\u003e el \u003e 1); // 1\n```\n\n### `asyncForEach()`\n\nExecutes a provided asynchronous function once for each array element.\n\nNote: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider `asyncForEachStrict()` instead.\n\n#### Sample usage\n\n```ts\nimport { asyncForEach } from '@wojtekmaj/async-array-utils';\n\nawait asyncForEach([1, 2, 3], async (el) =\u003e {\n  console.log(el * 2);\n}); // undefined; 3 console.logs\n```\n\n### `asyncForEachStrict()`\n\nLike `asyncForEach()`, but runs iterations non-concurrently.\n\n#### Sample usage\n\n```ts\nimport { asyncForEachStrict } from '@wojtekmaj/async-array-utils';\n\nconst indexes = [];\nawait asyncForEachStrict([1, 2, 3], async (el, index) =\u003e {\n  indexes.push(index);\n  console.log(el * 2);\n}); // undefined; 3 console.logs\nconsole.log(indexes); // [0, 1, 2]\n```\n\n### `asyncMap()`\n\nCreates a new array populated with the results of calling a provided asynchronous function on every element in the calling array.\n\nNote: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider `asyncMapStrict()` instead.\n\n#### Sample usage\n\n```ts\nimport { asyncMap } from '@wojtekmaj/async-array-utils';\n\nconst asyncMappedArr = await asyncMap([1, 2, 3], async (el) =\u003e el * 2); // [2, 4, 6]\n```\n\n### `asyncMapStrict()`\n\nLike `asyncMap()`, but runs iterations non-concurrently.\n\n#### Sample usage\n\n```ts\nimport { asyncMapStrict } from '@wojtekmaj/async-array-utils';\n\nconst indexes = [];\nconst asyncMappedArr = await asyncMapStrict([1, 2, 3], async (el, index) =\u003e {\n  indexes.push(index);\n  return el * 2;\n}); // [2, 4, 6]\nconsole.log(indexes); // [0, 1, 2]\n```\n\n### `asyncReduce()`\n\nExecutes a reducer asynchronous function (that you provide) on each element of the array, resulting in a single output value.\n\n#### Sample usage\n\n```ts\nimport { asyncReduce } from '@wojtekmaj/async-array-utils';\n\nconst result = await asyncReduce(\n  [1, 2, 3],\n  async (tmp, cur, idx) =\u003e {\n    return tmp + cur;\n  },\n  0,\n); // 6\n```\n\n### `asyncSome()`\n\nTests whether at least one element in the array pass the test implemented by the provided asynchronous function. It returns a Boolean value.\n\nNote: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects or execution order, consider `asyncMapStrict()` instead.\n\n#### Sample usage\n\n```ts\nimport { asyncSome } from '@wojtekmaj/async-array-utils';\n\nconst largerThanZero = await asyncSome([1, 2, 3], async (el) =\u003e el \u003e 0); // true\n```\n\n### `asyncSomeStrict()`\n\nLike `asyncSome()`, but runs iterations non-concurrently.\n\n#### Sample usage\n\n```ts\nimport { asyncSomeStrict } from '@wojtekmaj/async-array-utils';\n\nconst indexes = [];\nconst largerThanZero = await asyncSomeStrict([1, 2, 3], async (el, index) =\u003e {\n  indexes.push(index);\n  return el \u003e 0;\n}); // true\nconsole.log(indexes); // [0]\n```\n\n## License\n\nThe MIT License.\n\n## Author\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd \u003e\n      \u003cimg src=\"https://avatars.githubusercontent.com/u/5426427?v=4\u0026s=128\" width=\"64\" height=\"64\" alt=\"Wojciech Maj\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://github.com/wojtekmaj\"\u003eWojciech Maj\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekmaj%2Fasync-array-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwojtekmaj%2Fasync-array-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekmaj%2Fasync-array-utils/lists"}