Socket
Socket
Sign inDemoInstall

collect-stream

Package Overview
Dependencies
13
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    collect-stream

Collect a readable stream's output and errors


Version published
Weekly downloads
4.5K
decreased by-21.41%
Maintainers
1
Install size
234 kB
Created
Weekly downloads
 

Readme

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

Last updated on 12 Sep 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc