{"id":28684903,"url":"https://github.com/node-modules/await-stream-ready","last_synced_at":"2025-06-14T03:07:44.180Z","repository":{"id":57187954,"uuid":"86088966","full_name":"node-modules/await-stream-ready","owner":"node-modules","description":"a promise waiting stream ready","archived":false,"fork":false,"pushed_at":"2017-03-27T07:27:02.000Z","size":10,"stargazers_count":34,"open_issues_count":0,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-01T10:51:49.505Z","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/node-modules.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2017-03-24T16:31:09.000Z","updated_at":"2023-07-12T11:43:56.000Z","dependencies_parsed_at":"2022-08-28T13:00:20.212Z","dependency_job_id":null,"html_url":"https://github.com/node-modules/await-stream-ready","commit_stats":null,"previous_names":["node-modules/await-stream-ready","alibaba-archive/await-stream-ready"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/node-modules/await-stream-ready","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fawait-stream-ready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fawait-stream-ready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fawait-stream-ready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fawait-stream-ready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-modules","download_url":"https://codeload.github.com/node-modules/await-stream-ready/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fawait-stream-ready/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259752078,"owners_count":22905972,"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":"2025-06-14T03:07:37.329Z","updated_at":"2025-06-14T03:07:44.173Z","avatar_url":"https://github.com/node-modules.png","language":"JavaScript","readme":"# await-stream-ready\n\nA promise waiting stream ready\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![NPM download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/await-stream-ready.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/await-stream-ready\n[travis-image]: https://img.shields.io/travis/node-modules/await-stream-ready.svg?style=flat-square\n[travis-url]: https://travis-ci.org/node-modules/await-stream-ready\n[codecov-image]: https://codecov.io/gh/node-modules/await-stream-ready/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/node-modules/await-stream-ready\n[david-image]: https://img.shields.io/david/node-modules/await-stream-ready.svg?style=flat-square\n[david-url]: https://david-dm.org/node-modules/await-stream-ready\n[snyk-image]: https://snyk.io/test/npm/await-stream-ready/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/await-stream-ready\n[download-image]: https://img.shields.io/npm/dm/await-stream-ready.svg?style=flat-square\n[download-url]: https://npmjs.org/package/await-stream-ready\n\n---\n\n## Usage\n\n```bash\nnpm i await-stream-ready --save\n```\n\nWait a read stream\n\n```js\nconst fs = require('fs');\nconst awaitReadStream = require('await-stream-ready').read;\n\nasync function read(file) {\n  const stream = fs.createReadStream(file);\n  stream.on('data', buf =\u003e {\n    // consume buf\n  });\n  await awaitReadStream(stream);\n}\n```\n\nOr wait a write stream\n\n```js\nconst fs = require('fs');\nconst awaitWriteStream = require('await-stream-ready').write;\n\nasync function write(srcStream, file) {\n  const stream = srcStream.pipe(fs.createWriteStream(file));\n  await awaitWriteStream(stream);\n}\n```\n\n**It will switch the readable stream to flowing mode automatically.**\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fawait-stream-ready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-modules%2Fawait-stream-ready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fawait-stream-ready/lists"}