{"name":"read-all-stream","version":"0.1.1","description":"Read all stream content and pass it to callback","license":"MIT","repository":{"type":"git","url":"git://github.com/floatdrop/read-all-stream"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","coverage":"istanbul cover _mocha -- -R spec"},"files":["index.js"],"keywords":["stream","read","buffer","callback"],"devDependencies":{"istanbul":"^0.3.2","mocha":"*"},"bugs":{"url":"https://github.com/floatdrop/read-all-stream/issues"},"homepage":"https://github.com/floatdrop/read-all-stream","_id":"read-all-stream@0.1.1","_shasum":"e5dc47c24a5245f4738dcabf0a6aa4fd8a52cba6","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"floatdrop","email":"floatdrop@gmail.com"},"maintainers":[{"name":"floatdrop","email":"floatdrop@gmail.com"}],"dist":{"shasum":"e5dc47c24a5245f4738dcabf0a6aa4fd8a52cba6","tarball":"http://registry-npm.ywwl.com/read-all-stream/download/read-all-stream-0.1.1.tgz","integrity":"sha512-D6x8PMFF/iH89A0o2CFZ0gWKmShbFLraE/4/q+7Yl8gt8jxgyhOnF2MhDbSJ2oYntGMUTRrJKdSw5fCNIAcCdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICnmzf9zAfoFuApSJOuk5cJF0FwEJJSp7q1nT5jFvv0gAiBIbZX6+RnrSRLwckFXk7oDPNZD8/jbSW4ZBb3xu3hGVg=="}],"size":1974,"noattachment":false,"key":"/read-all-stream/-/read-all-stream-0.1.1.tgz"},"directories":{},"readme":"# read-all-stream [![Build Status][travis-image]][travis-url]\n\n> Read stream to buffer or string\n\n## Install\n\n```\n$ npm install --save read-all-stream\n```\n\n## Usage\n\n```js\nvar read = require('read-all-stream');\nvar stream = fs.createReadStream('index.js');\n\nread(stream).then(function (data) {\n\tconsole.log(data.length);\n});\n\nread(stream, 'utf8', function (err, data) {\n\tconsole.log(data.length);\n\t//=> 42\n});\n\n```\n\n### API\n\n#### read(stream, [options], [callback])\n\nIf callback is omitted, Promise will be returned.\n\n##### stream\n\n*Required*  \nType: `Stream`\n\nEvent emitter, which `data` events will be consumed.\n\n##### options\n\nType: `object` or `string`\n\nIf type of `options` is `string`, then it will be used as encoding.\nIf type is `Object`, then next options are available:\n\n##### options.encoding\n\nType: `string`, `null`  \nDefault: `'utf8'`\n\nEncoding to be used on `toString` of the data. If null, the body is returned as a Buffer.\n\n##### callback(err, data)\n\nWill be called after stream is read.\n\n###### err\n\n`Error` object (if `error` event happens).\n\n###### data\n\nThe data in stream.\n\n## License\n\nMIT © [Vsevolod Strukchinsky](floatdrop@gmail.com)\n\n[travis-url]: https://travis-ci.org/floatdrop/read-all-stream\n[travis-image]: https://img.shields.io/travis/floatdrop/read-all-stream.svg\n","publish_time":1415520790475,"_cnpm_publish_time":1415520790475,"dist-tags":{"latest":"3.1.0"}}