{"id":16682630,"url":"https://github.com/jchip/xaa","last_synced_at":"2025-08-04T04:34:52.306Z","repository":{"id":57400939,"uuid":"167412297","full_name":"jchip/xaa","owner":"jchip","description":"async/await/Promise helpers - delay, defer, timeout, each, map, filter","archived":false,"fork":false,"pushed_at":"2022-03-07T21:52:40.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T21:39:15.429Z","etag":null,"topics":["async","await","defer","delay","each","filter","helpers","map","promise","timeout"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchip.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":"2019-01-24T18:00:11.000Z","updated_at":"2022-03-03T19:18:50.000Z","dependencies_parsed_at":"2022-09-19T01:00:31.768Z","dependency_job_id":null,"html_url":"https://github.com/jchip/xaa","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxaa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxaa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxaa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxaa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchip","download_url":"https://codeload.github.com/jchip/xaa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283565,"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","await","defer","delay","each","filter","helpers","map","promise","timeout"],"created_at":"2024-10-12T14:08:07.381Z","updated_at":"2025-03-13T11:18:07.176Z","avatar_url":"https://github.com/jchip.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xaa\n\nasync/await and Promise helpers.\n\ngithub: \u003chttps://github.com/jchip/xaa\u003e\n\n## Install and Usage\n\n```\nnpm i xaa\n```\n\n## APIs\n\nAPI references \u003chttps://jchip.github.io/xaa/\u003e\n\nOr just use your IDE for hint if it supports TypeScript and typedoc.\n\n## Examples:\n\n### xaa.timeout\n\n```js\nimport { timeout } from \"xaa\";\n\nasync function test() {\n  // will throw TimeoutError\n  await timeout(50, \"took too long\").run(xaa.delay(100));\n  // will run the two functions and wait for them\n  await timeout(50, \"oops\")\n    .run([\n      () =\u003e xaa.delay(10, 1),\n      () =\u003e xaa.delay(15, 2),\n      \"some value\",\n      Promise.resolve(\"more value\")\n    ])\n    .then(results =\u003e {\n      // results === [1, 2, \"some value\", \"more value\"]\n    });\n}\n```\n\n### xaa.map\n\n```js\nimport { map } from xaa;\n\nasync function test() {\n  return await map(\n    [\"http://url1\", \"http://url2\"],\n    async url =\u003e fetch(url),\n    { concurrency: 2 }\n  );\n}\n```\n\n# License\n\nLicensed under the [Apache License, Version 2.0].\n\n[apache license, version 2.0]: https://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fxaa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchip%2Fxaa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fxaa/lists"}