{"_id":"await-stream-ready","_rev":"3-c1bc3739af8b6f6ae642be3aff6400f5","name":"await-stream-ready","description":"A promise waiting stream ready","dist-tags":{"latest":"1.0.1"},"versions":{"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","tarball":"https://registry.npmjs.org/await-stream-ready/-/await-stream-ready-1.0.0.tgz","integrity":"sha512-eFQ0IajLwVlxHSoLffjaf+AJKEof34ln1mBE5URB9JQczRm7UvLYPtsefBhj551RFepMnuKbz6GPFZDMzJdoLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICAJfyNy0IcLqu24AEPSroo95qcV7zBlI+De0iJMrWPEAiEAqAb3445HV60zTGVuIeA5F7eRS5Nn4ZhVRTgkK0jysgs="}]},"maintainers":[{"name":"popomore","email":"sakura9515@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/await-stream-ready-1.0.0.tgz_1490458347579_0.27428234554827213"}},"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","tarball":"https://registry.npmjs.org/await-stream-ready/-/await-stream-ready-1.0.1.tgz","integrity":"sha512-6ixSbvbBLztuO5BVFjb2N+8ol6W+/2hEGdmhIGYUPY8IsVU4Rg84WRoLRQRtz0nbhkx1Jnu7S7XiVAzW3lLF/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHDLH+31SN1WJkbCQg00+1Hi+PJaOUXySQI9cPIuH/7AIhAMopR8JZacLDpYa9pjaph3Jjp83HX2r2J/GjPWPJ9/sG"}]},"maintainers":[{"name":"popomore","email":"sakura9515@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/await-stream-ready-1.0.1.tgz_1490599717903_0.5810583042912185"}}},"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","maintainers":[{"name":"popomore","email":"sakura9515@gmail.com"}],"time":{"modified":"2022-06-13T03:52:43.534Z","created":"2017-03-25T16:12:27.824Z","1.0.0":"2017-03-25T16:12:27.824Z","1.0.1":"2017-03-27T07:28:38.132Z"},"homepage":"https://github.com/node-modules/await-stream-ready#readme","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/await-stream-ready.git"},"author":{"name":"popomore"},"bugs":{"url":"https://github.com/node-modules/await-stream-ready/issues"},"license":"MIT","readmeFilename":"README.md"}