{"name":"stream-to-promise","version":"2.1.1","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":"f2ac2be9cccfa6152e0fd588ed708de441783614","_id":"stream-to-promise@2.1.1","_shasum":"41cb72bf9d559c717b74cb850f52c043c34dd614","_from":".","_npmVersion":"3.9.5","_nodeVersion":"5.11.1","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"dist":{"shasum":"41cb72bf9d559c717b74cb850f52c043c34dd614","tarball":"http://registry-npm.ywwl.com/stream-to-promise/download/stream-to-promise-2.1.1.tgz","integrity":"sha512-nLGABl6Ez6ZIwkwA085/2d4USgGqY7F3KmWwP2xo1O1quw1wbGy7/qGdTV7NNxroHgS5dKOG17krMA1gnL4ycw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGEJ2Bz0CslXEjSJxz8uPZJYo66Sfr9NuwqpL/YNXrCQAiAW6F4fFnsBNt8oJBNERmDCEEO4jsWp/O/GiKYFIJtw3g=="}],"size":1877,"noattachment":false,"key":"/stream-to-promise/-/stream-to-promise-2.1.1.tgz"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-to-promise-2.1.1.tgz_1466541270085_0.684264492476359"},"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":1466541272768,"deprecated":"Deprecated. Use node:stream/promises and node:stream/consumers instead.","_cnpm_publish_time":1466541272768,"dist-tags":{"latest":"3.0.0"}}