Package Exports
- collect-all
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (collect-all) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
collect-all
Returns a stream which fires a callback and becomes readable once all input is received. Intended for buffer/string streams.
collect([callback], [options]) ⇒ Duplex
⏏
Kind: Exported function
Param | Type | Description |
---|---|---|
[callback] | function |
called with the collected json data, once available. The value returned by the callback will be passed downstream. |
[options] | object |
passed to through stream constructor created to house the above callback function.. If the callback function returns a non-string/buffer value, set objectMode: true . |
Example
An example command-line client script - JSON received at stdin is stamped with received
then written to stdout.
var collectAll = require("collect-all")
process.stdin
.pipe(collectAll(function(input){
input += 'received'
return input
}))
.on("error", function(err){
// input from stdin failed to parse
})
.pipe(process.stdout)
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.