{"name":"stream-to-promise","version":"0.0.1","description":"Convert readable streams to promises","main":"index.js","scripts":{"test":"mocha test.js"},"repository":{"type":"git","url":"git://github.com/valet-io/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/valet-io/stream-to-promise/issues"},"homepage":"https://github.com/valet-io/stream-to-promise","dependencies":{"bluebird":"~1.1.0","stream-to-array":"~1.0.0"},"devDependencies":{"chai-as-promised":"~4.1.1","chai":"~1.9.0","mocha":"~1.18.0","mocha-as-promised":"~2.0.0"},"_id":"stream-to-promise@0.0.1","dist":{"shasum":"3e6de76b9f3561208e3fb7d5d51961e41f6067c1","tarball":"http://registry-npm.ywwl.com/stream-to-promise/download/stream-to-promise-0.0.1.tgz","integrity":"sha512-LlPpkInzJ8diJlt5SVmFJAOf7Mf40vRJTTZATREjN6f+X7FDDU9y3KVMNDfk7wKYdYpscTP+UFtFz4oCfK3KMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQWpr/f1jgzM14AKqy0eKxsIRzFhIB3DSI9qf81IfREQIgfOxE1E321jigzKSPx10NUGGUXlSQGEpC3NLzjMhZMBo="}],"size":2353,"noattachment":false,"key":"/stream-to-promise/-/stream-to-promise-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"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":1395009066253,"deprecated":"Deprecated. Use node:stream/promises and node:stream/consumers instead.","_cnpm_publish_time":1395009066253,"dist-tags":{"latest":"3.0.0"}}