{"_id":"stream-to-array","_rev":"6276","name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","dist-tags":{"latest":"2.3.0"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"time":{"modified":"2021-06-03T09:56:52.000Z","created":"2013-12-04T10:24:13.851Z","2.3.0":"2016-02-28T02:22:07.458Z","2.2.1":"2016-01-14T07:59:14.577Z","2.2.0":"2015-11-05T18:01:03.514Z","2.1.0":"2015-10-21T05:26:50.057Z","2.0.2":"2014-08-29T20:13:00.348Z","2.0.1":"2014-08-29T19:19:49.711Z","2.0.0":"2014-07-11T23:56:42.057Z","1.0.0":"2013-12-04T10:24:13.851Z"},"users":{"rsp":true,"amio":true,"n370":true,"preco21":true,"level9i":true,"drewigg":true},"author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"repository":{"type":"git","url":"git+https://github.com/stream-utils/stream-to-array.git"},"versions":{"2.3.0":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.3.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/stream-utils/stream-to-array.git"},"dependencies":{"any-promise":"^1.1.0"},"devDependencies":{"bluebird":"^3.1.1","istanbul":"^0.4.2","mocha":"^2.3.3"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"e22b0b2719dc19c70a94a73081590cf2892dc0ba","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array#readme","_id":"stream-to-array@2.3.0","_shasum":"bbf6b39f5f43ec30bc71babcb37557acecf34353","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"bbf6b39f5f43ec30bc71babcb37557acecf34353","size":2414,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.3.0.tgz"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/stream-to-array-2.3.0.tgz_1456626126387_0.17467772774398327"},"directories":{},"publish_time":1456626127458,"_cnpm_publish_time":1456626127458,"_hasShrinkwrap":false},"2.2.1":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.2.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/stream-utils/stream-to-array.git"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"^3.1.1","istanbul":"0","mocha":"^2.3.3","trycatch":"^1.5.21"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"d6478ccf9dae38cad957aca298e4b92216148c28","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array#readme","_id":"stream-to-array@2.2.1","_shasum":"08661492bbd02bf38ce6cb880144c83f2abd07a9","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"08661492bbd02bf38ce6cb880144c83f2abd07a9","size":2421,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.2.1.tgz"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{},"publish_time":1452758354577,"_cnpm_publish_time":1452758354577,"_hasShrinkwrap":false},"2.2.0":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.2.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/stream-utils/stream-to-array.git"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"^2.3.3"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"c9ddaf02b7e4f8504e9cc1ff42cd5d1fddbb5c0d","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array#readme","_id":"stream-to-array@2.2.0","_shasum":"357a7cdab1e0462c9bc4ea15b461b1378245d3bc","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"357a7cdab1e0462c9bc4ea15b461b1378245d3bc","size":2378,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.2.0.tgz"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{},"publish_time":1446746463514,"_cnpm_publish_time":1446746463514,"_hasShrinkwrap":false},"2.1.0":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.1.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/stream-utils/stream-to-array.git"},"dependencies":{"bluebird":"2","native-or-bluebird":"1"},"devDependencies":{"istanbul":"0","mocha":"^2.3.3"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"09338d4dc6bbd904a9ae0693ec586ee7441c35c1","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array#readme","_id":"stream-to-array@2.1.0","_shasum":"9aff24094f58b6d600c3c06297f9ab7fb9ba3ee0","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"9aff24094f58b6d600c3c06297f9ab7fb9ba3ee0","size":2387,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.1.0.tgz"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{},"publish_time":1445405210057,"_cnpm_publish_time":1445405210057,"_hasShrinkwrap":false},"2.0.2":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.0.2","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/stream-utils/stream-to-array"},"dependencies":{"bluebird":"2","native-or-bluebird":"1"},"devDependencies":{"mocha":"1","istanbul":"0"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"2e837fe2dd470b6beda42a518c69e7a35a625194","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array","_id":"stream-to-array@2.0.2","_shasum":"68b006bb494614fb2ba198336c0192f8c2679c24","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"68b006bb494614fb2ba198336c0192f8c2679c24","size":1698,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.0.2.tgz"},"directories":{},"publish_time":1409343180348,"_cnpm_publish_time":1409343180348,"_hasShrinkwrap":false},"2.0.1":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.0.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/stream-utils/stream-to-array"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","mocha":"1","istanbul":"0"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"keywords":["stream","streams","buffer","array","concat"],"gitHead":"7a4091efc6b49dccd736d5695f851714d52dff38","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array","_id":"stream-to-array@2.0.1","_shasum":"a5a95b00082ae5452ce7accfa4b8fd4a247dfaa5","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"a5a95b00082ae5452ce7accfa4b8fd4a247dfaa5","size":1695,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.0.1.tgz"},"directories":{},"publish_time":1409339989711,"_cnpm_publish_time":1409339989711,"_hasShrinkwrap":false},"2.0.0":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"2.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/stream-utils/stream-to-array"},"dependencies":{"bluebird":"2"},"devDependencies":{"mocha":"1","istanbul":"0"},"scripts":{"test":"mocha --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"files":["index.js"],"gitHead":"d6ca1dcef9d9bbd585e4a42a3ad0e070f0eeaeab","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"homepage":"https://github.com/stream-utils/stream-to-array","_id":"stream-to-array@2.0.0","_shasum":"6da77ecc50e3f739aac62d44e48c69c096d9f38d","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"6da77ecc50e3f739aac62d44e48c69c096d9f38d","size":1509,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-2.0.0.tgz"},"directories":{},"publish_time":1405123002057,"_cnpm_publish_time":1405123002057,"_hasShrinkwrap":false},"1.0.0":{"name":"stream-to-array","description":"Concatenate a readable stream's data into a single array","version":"1.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/stream-utils/stream-to-array.git"},"bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"devDependencies":{"co":"*","gnode":"*","mocha":"*"},"scripts":{"test":"NODE=gnode make test"},"engines":{"node":">= 0.10.0"},"readmeFilename":"README.md","homepage":"https://github.com/stream-utils/stream-to-array","_id":"stream-to-array@1.0.0","dist":{"shasum":"94166bb29f3ea24f082d2f8cd3ebb2cc0d6eca2c","size":2169,"noattachment":false,"key":"/stream-to-array/-/stream-to-array-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-to-array/download/stream-to-array-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"dougwilson","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{},"publish_time":1386152653851,"_cnpm_publish_time":1386152653851,"_hasShrinkwrap":false}},"readme":"# Stream to Array\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nConcatenate a readable stream's data into a single array.\n\nYou may also be interested in:\n\n- [raw-body](https://github.com/stream-utils/raw-body) for strings\n\n## API\n\n```js\nvar toArray = require('stream-to-array')\n```\n\n### toArray([stream], [callback(err, arr)])\n\nReturns all the data objects in an array.\nThis is useful for streams in object mode if you want to just use an array.\n\n```js\nvar stream = new Stream.Readable()\ntoArray(stream, function (err, arr) {\n  assert.ok(Array.isArray(arr))\n})\n```\n\nIf `stream` is not defined, it is assumed that `this` is a stream.\n\n```js\nvar stream = new Stream.Readable()\nstream.toArray = toArray\nstream.toArray(function (err, arr) {\n\n})\n```\n\nIf `callback` is not defined, then it returns a promise.\n\n```js\ntoArray(stream)\n  .then(function (parts) {\n\n  })\n```\n\nIf you want to return a buffer, just use `Buffer.concat(arr)`\n\n```js\ntoArray(stream)\n  .then(function (parts) {\n    var buffers = []\n    for (var i = 0, l = parts.length; i < l ; ++i) {\n      var part = parts[i]\n      buffers.push((part instanceof Buffer) ? part : new Buffer(part))\n    }\n    return Buffer.concat(buffers)\n  })\n```\n\n[npm-image]: https://img.shields.io/npm/v/stream-to-array.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/stream-to-array\n[github-tag]: http://img.shields.io/github/tag/stream-utils/stream-to-array.svg?style=flat-square\n[github-url]: https://github.com/stream-utils/stream-to-array/tags\n[travis-image]: https://img.shields.io/travis/stream-utils/stream-to-array.svg?style=flat-square\n[travis-url]: https://travis-ci.org/stream-utils/stream-to-array\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/stream-to-array.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/stream-utils/stream-to-array?branch=master\n[david-image]: http://img.shields.io/david/stream-utils/stream-to-array.svg?style=flat-square\n[david-url]: https://david-dm.org/stream-utils/stream-to-array\n[license-image]: http://img.shields.io/npm/l/stream-to-array.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/stream-to-array.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/stream-to-array\n","_attachments":{},"homepage":"https://github.com/stream-utils/stream-to-array#readme","bugs":{"url":"https://github.com/stream-utils/stream-to-array/issues"},"license":"MIT"}