Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

collect-stream

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-stream

Collect a readable stream's output and errors

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

collect-stream

Collect a readable stream's output and errors.

build status

Usage

Give it a readable stream and a function and it will call latter with the potential error and a smart representation of the data the stream emitted.

import collect from 'collect-stream';

collect(stringStream, (err, data) => {
  console.log(data); // one string
});

collect(bufferStream, (err, data) => {
  console.log(data); // one buffer
});

collect(objectStream, (err, data) => {
  console.log(data); // an array of objects
});

Give it options and it will pass them to concat-stream.

import collect from 'collect-stream';

collect(someStream, {
  encoding: 'object'
}, (err, data) => {
  console.log(data) // forced to be an array of objects
});

Installation

$ npm install collect-stream

License

MIT

Keywords

FAQs

Package last updated on 12 Sep 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