{"id":16490714,"url":"https://github.com/awinterman/node-await-stream","last_synced_at":"2026-06-09T12:31:42.337Z","repository":{"id":15581608,"uuid":"18317247","full_name":"AWinterman/node-await-stream","owner":"AWinterman","description":"A readable stream which demuxes other readable streams","archived":false,"fork":false,"pushed_at":"2014-04-01T20:06:09.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T00:04:51.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/AWinterman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-01T04:02:01.000Z","updated_at":"2017-10-20T02:21:54.000Z","dependencies_parsed_at":"2022-08-29T10:30:30.138Z","dependency_job_id":null,"html_url":"https://github.com/AWinterman/node-await-stream","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/AWinterman%2Fnode-await-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-await-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-await-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-await-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWinterman","download_url":"https://codeload.github.com/AWinterman/node-await-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241325902,"owners_count":19944460,"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-10-11T13:48:49.781Z","updated_at":"2026-06-09T12:31:42.309Z","avatar_url":"https://github.com/AWinterman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Await Stream\n\nA stream which listens to a collection of streams. When they emit, it collects\ntheir data into a single object, and then emits the new object when they've all\nemitted.\n\n```javascript\nvar await_stream = require('await_stream')\n  , through = require('through')\n\n// these will be pass through streams, that we will `.push` to once our\n// listeners are set up.\nvar a = through()\n  , b = through()\n  , c = through()\n\nvar collection = await_stream({a: a, b: b, c: c})\n\ncollection.on('data', function(data) {\n  // a_stream's data is:\n  console.log('a', data.a)\n\n  // b stream's data is:\n  console.log('b', data.b)\n\n  // c stream's data is:\n  console.log('c', data.c)\n})\n\n// Nothing is emitted until all keys are accounted for:\na.push(1)\nb.push(200)\nb.push(20)\nb.push(2)\n\n// No data is emitted until:\n\nc.push(3)\n// data is {a: 1, b: 2, c: 3}, and the counter is reset. So any two of the\n// three streams a, b, c could emit 'data'  without emitting.\n```\n\n## API:\n\n`await_stream(streams) -\u003e ReadableStream`\n\n`streams` is expected to be a object mapping names to streams. The\nreturned stream emits, objects with the same keys as the passed in object, but\nwith the values emitted by each stream as the values of the object.\n\nNote that each time all keys become accounted before, the ReadableStream emits\na data event, and then resets itself to its initial state.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fnode-await-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawinterman%2Fnode-await-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fnode-await-stream/lists"}