{"_id":"await-stream-ready","_rev":"2893321","name":"await-stream-ready","description":"A promise waiting stream ready","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"popomore","email":""}],"time":{"modified":"2022-11-30T02:15:01.000Z","created":"2017-03-25T16:12:27.824Z","1.0.1":"2017-03-27T07:28:38.132Z","1.0.0":"2017-03-25T16:12:27.824Z"},"users":{},"author":{"name":"popomore"},"repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/await-stream-ready.git"},"versions":{"1.0.1":{"name":"await-stream-ready","version":"1.0.1","description":"A promise waiting stream ready","dependencies":{},"devDependencies":{"autod":"^2.8.0","egg-bin":"^1.10.3","egg-ci":"^1.6.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz":"^2.6.0","spy":"^1.0.0"},"engines":{"node":">=4.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov"},"ci":{"version":"4, 6, 7","license":{"fullname":"node-modules","year":"2017"}},"repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/await-stream-ready.git"},"author":{"name":"popomore"},"license":"MIT","files":["index.js","lib"],"gitHead":"8382fa5e94d527268828766c45b0361fb5421196","bugs":{"url":"https://github.com/node-modules/await-stream-ready/issues"},"homepage":"https://github.com/node-modules/await-stream-ready#readme","_id":"await-stream-ready@1.0.1","_shasum":"fa308c63fe14ac7a90966ad70822aa9369f8a6bb","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"fa308c63fe14ac7a90966ad70822aa9369f8a6bb","size":2349,"noattachment":false,"key":"/await-stream-ready/-/await-stream-ready-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/await-stream-ready/download/await-stream-ready-1.0.1.tgz"},"maintainers":[{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/await-stream-ready-1.0.1.tgz_1490599717903_0.5810583042912185"},"directories":{},"publish_time":1490599718132,"_hasShrinkwrap":false,"_cnpm_publish_time":1490599718132,"_cnpmcore_publish_time":"2021-12-16T15:36:44.968Z"},"1.0.0":{"name":"await-stream-ready","version":"1.0.0","description":"A promise waiting stream ready","dependencies":{"isstream":"^0.1.2"},"devDependencies":{"autod":"^2.8.0","egg-bin":"^1.10.3","egg-ci":"^1.6.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz":"^2.6.0","spy":"^1.0.0"},"engines":{"node":">=4.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov"},"ci":{"version":"4, 6, 7","license":{"fullname":"node-modules","year":"2017"}},"repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/await-stream-ready.git"},"author":{"name":"popomore"},"license":"MIT","gitHead":"9f8d6b631ec001a70131e363dd8d25867829a98d","bugs":{"url":"https://github.com/node-modules/await-stream-ready/issues"},"homepage":"https://github.com/node-modules/await-stream-ready#readme","_id":"await-stream-ready@1.0.0","_shasum":"b911e2968fa326ca584936ab4bf99c63432b4f73","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"b911e2968fa326ca584936ab4bf99c63432b4f73","size":7270,"noattachment":false,"key":"/await-stream-ready/-/await-stream-ready-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/await-stream-ready/download/await-stream-ready-1.0.0.tgz"},"maintainers":[{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/await-stream-ready-1.0.0.tgz_1490458347579_0.27428234554827213"},"directories":{},"publish_time":1490458347824,"_hasShrinkwrap":false,"_cnpm_publish_time":1490458347824,"_cnpmcore_publish_time":"2021-12-16T15:36:45.180Z"}},"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 => {\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","_attachments":{},"homepage":"https://github.com/node-modules/await-stream-ready#readme","bugs":{"url":"https://github.com/node-modules/await-stream-ready/issues"},"license":"MIT"}