{"id":22342476,"url":"https://github.com/eyal-shalev/async_channels","last_synced_at":"2025-08-05T15:07:50.044Z","repository":{"id":40236727,"uuid":"401826915","full_name":"Eyal-Shalev/async_channels","owner":"Eyal-Shalev","description":"Inspired by Go \u0026 Clojure Channels, async_channels provides channels as an asynchronous communication method between asynchronous functions.","archived":false,"fork":false,"pushed_at":"2024-09-03T21:35:11.000Z","size":417,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-05T14:19:25.313Z","etag":null,"topics":["async","channel","channels","deno","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://eyal-shalev.github.io/async_channels/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eyal-Shalev.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":"2021-08-31T19:53:35.000Z","updated_at":"2021-10-20T20:47:12.000Z","dependencies_parsed_at":"2022-09-26T20:40:23.690Z","dependency_job_id":null,"html_url":"https://github.com/Eyal-Shalev/async_channels","commit_stats":null,"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"purl":"pkg:github/Eyal-Shalev/async_channels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyal-Shalev%2Fasync_channels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyal-Shalev%2Fasync_channels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyal-Shalev%2Fasync_channels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyal-Shalev%2Fasync_channels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eyal-Shalev","download_url":"https://codeload.github.com/Eyal-Shalev/async_channels/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyal-Shalev%2Fasync_channels/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267792737,"owners_count":24144931,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","channel","channels","deno","javascript","typescript"],"created_at":"2024-12-04T08:12:49.442Z","updated_at":"2025-07-30T01:32:38.778Z","avatar_url":"https://github.com/Eyal-Shalev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Async Channels\n\n[![Latest Version](https://img.shields.io/github/v/release/eyal-shalev/async_channels?sort=semver\u0026label=Version)](https://github.com/Eyal-Shalev/async_channels)\n[![Test](https://github.com/Eyal-Shalev/async_channels/actions/workflows/test.yml/badge.svg)](https://github.com/Eyal-Shalev/async_channels/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/Eyal-Shalev/async_channels/branch/main/graph/badge.svg?token=9EWOZTN2BP)](https://codecov.io/gh/Eyal-Shalev/async_channels)\n[![nodejs minimum version](https://img.shields.io/node/v/@eyalsh/async_channels)](https://www.npmjs.com/package/@eyalsh/async_channels)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\nChannels are queue-like objects _(First In First Out)_ that their `enqueue`\n(send) and `dequeue` (get) functions are asynchronous (`async`). By passing them\nbetween asynchronous functions we can synchronize operations between said\nfunctions.\n\n## Setup\n\n### NodeJS\n\nReleased under both npmjs \u0026 github packages:\n\n[![npmjs.com:@eyalsh/async_channels](https://img.shields.io/badge/npmjs.com-%40eyalsh%2Fasync__channels-%23cc0000)](https://www.npmjs.com/package/@eyalsh/async_channels)\n[![github.com:@Eyal-Shalev/async_channels](https://img.shields.io/badge/github.com-%40eyal--shalev%2Fasync__channels-%233399db)](https://github.com/Eyal-Shalev/async_channels/packages/983326)\n\n**Install:**\n\n\u003cdetails open markdown=\"block\"\u003e\n\u003csummary\u003enpm\u003c/summary\u003e\n\n```shell\nnpm install @eyalsh/async_channels\n```\n\n\u003c/details\u003e\n\n\u003cdetails markdown=\"block\"\u003e\n\u003csummary\u003eyarn\u003c/summary\u003e\n\n```shell\nyarn add @eyal-shalev/async_channels\n```\n\n\u003c/details\u003e\n\n**import (ES Modules):**\n\n```js\nimport { Channel } from \"@eyalsh/async_channels\";\n```\n\n**require (CommonJS):**\n\n```js\nconst { Channel } = require(\"@eyalsh/async_channels\");\n```\n\n### Deno\n\nThe library is available to import from\n[deno.land/x/async_channels](://deno.land/x/async_channels)\n\n```ts\nimport { Channel } from \"https://deno.land/x/async_channels/mod.ts\";\n```\n\n### Browser - CDN / Download\n\nYou can import the library from any CDN that mirrors _npmjs.com_, such as\n[skypack.dev](://skypack.dev/view/@eyalsh/async_channels) or\n[unpkg.com](https://unpkg.com/@eyalsh/async_channels/dist/async_channels.esm.js).\n\n```js\nimport { Channel } from \"https://cdn.skypack.dev/@eyalsh/async_channels\";\n```\n\nOr you can download compiled library from GitHub:\n\n- [Latest Release](://github.com/Eyal-Shalev/async_channels/releases/latest)\n- [All Releases](://github.com/Eyal-Shalev/async_channels/releases)\n\n```js\nimport { Channel } from \"/path/to/async_channels.esm.js\";\n```\n\n_Note: an IIFE version also exist, if your application doesn't support ES\nmodules._\n\n```html\n\u003cscript src=\"/path/to/async_channels.iife.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const {Channel} = async_channels;\n\u003c/script\u003e\n```\n\n## Examples\n\n- [middleware (ping-pong)](/examples/middleware)\n\n- [pipeline (even or odd)](/examples/even-or-odd-pipeline)\n\n- [pipeline (lorem-ipsum)](/examples/lorem-ipsum-pipeline)\n\n- [Message Queue](/examples/message-queue)\n\n- [static site (todos app)](/examples/todos-static)\n\n- ```ts\n  import { Channel, time } from \"https://deno.land/x/async_channels/mod.ts\";\n\n  function produce(num: number) {\n    return Channel.from((async function* () {\n      for (let i = 0; i \u003c num; i++) {\n        await time.timeout(100).get(); // Do some work...\n        yield i;\n      }\n    })());\n  }\n\n  time.timeout(300).get().then(() =\u003e console.log(\"boo\"));\n\n  for await (const product of produce(4)) {\n    console.log({ product });\n  }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyal-shalev%2Fasync_channels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyal-shalev%2Fasync_channels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyal-shalev%2Fasync_channels/lists"}