Socket
Socket
Sign inDemoInstall

collect-all

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-all

Returns a stream which becomes readable once all input is received


Version published
Weekly downloads
144K
increased by10.34%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads per month Build Status Dependency Status js-standard-style

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

ParamTypeDescription
[callback]functioncalled with the collected json data, once available. The value returned by the callback will be passed downstream.
[options]objectpassed 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.

FAQs

Package last updated on 02 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc