{"name":"stream-to-promise","version":"2.1.0","description":"Convert streams (readable or writable) to promises","main":"index.js","scripts":{"test":"standard && mocha test.js"},"repository":{"type":"git","url":"git://github.com/bendrucker/stream-to-promise.git"},"keywords":["stream","promise"],"author":{"name":"Ben Drucker","email":"bvdrucker@gmail.com","url":"http://www.bendrucker.me"},"license":"MIT","bugs":{"url":"https://github.com/bendrucker/stream-to-promise/issues"},"homepage":"https://github.com/bendrucker/stream-to-promise","dependencies":{"any-promise":"~1.3.0","stream-to-array":"~2.3.0"},"devDependencies":{"bluebird":"~3.4.1","chai":"^3.4.1","chai-as-promised":"^5.1.0","delayed-stream":"^1.0.0","mocha":"^2.3.4","rimraf":"^2.4.4","standard":"^5.4.1"},"files":["index.js"],"gitHead":"d74c3c021d88d8f87df0342a6d9df11eaa40da6b","_id":"stream-to-promise@2.1.0","_shasum":"4255f3d59f851aae89327ddba903b79abbf298a8","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.1","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"dist":{"shasum":"4255f3d59f851aae89327ddba903b79abbf298a8","tarball":"http://registry-npm.ywwl.com/stream-to-promise/download/stream-to-promise-2.1.0.tgz","integrity":"sha512-d/hSSLawtXBP0VTPNs3HH/VLMS51B3CofHzon2go9xYho9VfEWrvg0vCI8ZQh1LYZfUao8NqlSAxJNSoh7DHvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnrHtyPjewHlDgPdF800JUaFAOL3tzepaTGF5DMm62iwIgQr+m06PRHh+AHiwXaB2rE91aur+uNqlm9lt53HufxsA="}],"size":1891,"noattachment":false,"key":"/stream-to-promise/-/stream-to-promise-2.1.0.tgz"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/stream-to-promise-2.1.0.tgz_1466223763822_0.3490296599920839"},"directories":{},"readme":"# stream-to-promise [![Build Status](https://travis-ci.com/bendrucker/stream-to-promise.svg?branch=master)](https://travis-ci.com/bendrucker/stream-to-promise)\n\n> Convert streams (readable or writable) to promises\n\n## Installing\n\n```sh\nnpm install --save stream-to-promise\n```\n\n## Examples\n\n### Readable Streams\n\n```js\nstreamToPromise(readableStream).then(function (buffer) {\n  // buffer.length === 3\n})\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('end') // promise is resolved here\n```\n\n### Writable Streams\n\n```js\nstreamToPromise(writableStream).then(function () {\n  // resolves undefined\n})\nwritableStream.write('data')\nwritableStream.end() // promise is resolved here\n```\n\n### Error Handling\n\n```js\nconst err = new Error()\nstreamToPromise(stream).catch(function (error) {\n  // error === err\n})\nstream.emit('error', err) // promise is rejected here\n```\n","publish_time":1466223764256,"deprecated":"Deprecated. Use node:stream/promises and node:stream/consumers instead.","_cnpm_publish_time":1466223764256,"dist-tags":{"latest":"3.0.0"}}