{"id":23078250,"url":"https://github.com/basementuniverse/async","last_synced_at":"2026-02-09T05:37:08.198Z","repository":{"id":57681508,"uuid":"481301292","full_name":"basementuniverse/async","owner":"basementuniverse","description":"Async versions of common list functions","archived":false,"fork":false,"pushed_at":"2024-12-29T17:59:42.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T02:32:52.634Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/basementuniverse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-13T16:56:24.000Z","updated_at":"2024-12-29T17:59:45.000Z","dependencies_parsed_at":"2022-09-13T20:30:45.998Z","dependency_job_id":null,"html_url":"https://github.com/basementuniverse/async","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/basementuniverse%2Fasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basementuniverse%2Fasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basementuniverse%2Fasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basementuniverse%2Fasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basementuniverse","download_url":"https://codeload.github.com/basementuniverse/async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237894352,"owners_count":19383170,"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-12-16T10:52:41.186Z","updated_at":"2026-02-09T05:37:03.178Z","avatar_url":"https://github.com/basementuniverse.png","language":"TypeScript","readme":"# Async\n\nAsync versions of common list functions.\n\n## Installation\n\n```\nnpm install @basementuniverse/async\n```\n\n## Usage\n\nSee [docs](docs/globals.md) for more information.\n\n### asyncForEach\n\n```typescript\nimport { asyncForEach } from '@basementuniverse/async';\n\nawait asyncForEach\u003cstring\u003e(\n  [\n    'one',\n    'two',\n    'three',\n  ],\n  async (value: string) =\u003e {\n    await fetch(`localhost:8080/${value}`);\n  }\n);\n```\n\n---\n\n### asyncMap\n\n```typescript\nimport { asyncMap } from '@basementuniverse/async';\n\nconst results = await asyncMap\u003cstring, number\u003e(\n  [\n    '123',\n    '456',\n    '789',\n  ],\n  async (value: string) =\u003e {\n    // asynchronous stuff here...\n    return Number(value);\n  }\n);\n\n/*\nresults: [123, 456, 789]\n\nNote that the order of results might be different.\n*/\n\n```\n\n---\n\n### asyncFilter\n\n```typescript\nimport { asyncFilter } from '@basementuniverse/async';\n\nconst results = await asyncFilter\u003cstring\u003e(\n  [\n    'allowed1',\n    'notAllowed2',\n    'allowed3',\n    'notAllowed4',\n  ],\n  async (value: string) =\u003e {\n    // asynchronous stuff here...\n    return value.startsWith('allowed');\n  }\n);\n\n/*\nresults: ['allowed1', 'allowed2']\n\nNote that the order of results might be different.\n*/\n```\n\n---\n\n### asyncReduce\n\n```typescript\nimport { asyncReduce } from '@basementuniverse/async';\n\nconst result = await asyncReduce\u003cstring, number\u003e(\n  [\n    '1',\n    '2',\n    '3',\n  ],\n  async (previous: number, current: string) =\u003e {\n    // asynchronous stuff here...\n    return previous + Number(current);\n  },\n  0\n);\n\n/*\nresult: 6\n*/\n```\n\n---\n\n### asyncFind\n\n```typescript\nimport { asyncFind } from '@basementuniverse/async';\n\nconst result = await asyncFind\u003cstring\u003e(\n  [\n    'one',\n    'two',\n    'three',\n  ],\n  async (value: string) =\u003e {\n    // asynchronous stuff here...\n    return value === 'two';\n  }\n);\n\n/*\nresult: 'two'\n*/\n```\n\n---\n\n### asyncFindIndex\n\n```typescript\nimport { asyncFindIndex } from '@basementuniverse/async';\n\nconst result = await asyncFindIndex\u003cstring\u003e(\n  [\n    'one',\n    'two',\n    'three',\n  ],\n  async (value: string) =\u003e {\n    // asynchronous stuff here...\n    return value === 'two';\n  }\n);\n\n/*\nresult: 1\n*/\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasementuniverse%2Fasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasementuniverse%2Fasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasementuniverse%2Fasync/lists"}