{"name":"collect-all","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.2.0","description":"Returns a stream which becomes readable once all input is received","repository":{"type":"git","url":"git+https://github.com/75lb/collect-all.git"},"license":"MIT","main":"./lib/collect-all.js","keywords":[],"engines":{"node":">=0.10.0"},"scripts":{"test":"tape test/*.js","lint":"jshint lib/*.js bin/*.js test/*.js; echo","docs":"jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo"},"dependencies":{"stream-connect":"~0.1.0","stream-via":"~0.1.0","typical":"^2.3.0"},"devDependencies":{"jsdoc-to-markdown":"^1.1.1","tape":"^4.0.0"},"gitHead":"1606f5515bff1eba1fc8fe33f7cb3e4ac840078d","bugs":{"url":"https://github.com/75lb/collect-all/issues"},"homepage":"https://github.com/75lb/collect-all#readme","_id":"collect-all@0.2.0","_shasum":"3413c60081db4bf81031b002801641f5f7574996","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.3.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"3413c60081db4bf81031b002801641f5f7574996","tarball":"http://registry-npm.ywwl.com/collect-all/download/collect-all-0.2.0.tgz","integrity":"sha512-agOawLWwNu8Jln+2yg8IRtRokfue+UibmXjA6bXwRiEmpxrjB37Txok0GKVLbM5eQs4NcYho0s3uNwZK/mlrVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcZaeGhr01swb2xkKp5WBQVsr4XNmewo5EurRIShB6xAiEAxF5d/z9v3IurEmTQXBfEtsFENw4gp6qIb68lxmzjejE="}],"size":2932,"noattachment":false,"key":"/collect-all/-/collect-all-0.2.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"readme":"[![view on npm](https://img.shields.io/npm/v/collect-all.svg)](https://www.npmjs.org/package/collect-all)\n[![npm module downloads](https://img.shields.io/npm/dt/collect-all.svg)](https://www.npmjs.org/package/collect-all)\n[![Build Status](https://travis-ci.org/75lb/collect-all.svg?branch=master)](https://travis-ci.org/75lb/collect-all)\n[![Dependency Status](https://david-dm.org/75lb/collect-all.svg)](https://david-dm.org/75lb/collect-all)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n<a name=\"module_collect-all\"></a>\n\n***DEPRECATED. This package has been replaced by [stream-read-all](https://github.com/75lb/stream-read-all) which does the same job but with a Promises interface.***\n\n\n## collect-all\nReturns a stream which fires a callback and becomes readable once all input is received.\n\nBy default the callback is invoked with a Buffer instance containing all concatenated input. If you set the option `{ objectMode: true }` the callback is invoked with an array containing all objects received.\n\n<a name=\"exp_module_collect-all--collectAll\"></a>\n\n### collectAll([callback], [options]) ⇒ [<code>Duplex</code>](https://nodejs.org/api/stream.html#stream_class_stream_duplex) ⏏\n**Kind**: Exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| [callback] | <code>function</code> | Called once with the collected input data (by default a `Buffer` instance, or array in `objectMode`.). The value returned by this callback function will be passed downstream. |\n| [options] | <code>object</code> | [Stream options](https://nodejs.org/dist/latest-v5.x/docs/api/stream.html#stream_new_stream_readable_options) object, passed to the constructor for the stream returned by `collect-all`. If the callback function supplied returns a non-string/buffer value, set `options.objectMode` to `true`. |\n\n**Example**\nAn example command-line client script - string input received at stdin is stamped with `received` then written to  stdout.\n```js\nvar collectAll = require('collect-all')\nprocess.stdin\n  .pipe(collectAll(function (input) {\n    input = 'received: ' + input\n    return input\n  }))\n  .pipe(process.stdout)\n```\n\nAn object-mode example:\n```js\nvar collectAll = require('collect-all')\n\nfunction onAllCollected (collected) {\n  console.log('Objects collected: ' + collected.length)\n}\n\nvar stream = collectAll(onAllCollected, { objectMode: true })\nstream.write({})\nstream.write({})\nstream.end({}) // outputs 'Objects collected: 3'\n```\n\n* * *\n\n&copy; 2015-17 Lloyd Brookes \\<75pound@gmail.com\\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1450823980125,"_cnpm_publish_time":1450823980125,"dist-tags":{"latest":"1.0.4"}}