🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

combine-streams

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combine-streams

Append streams and data into one mother stream

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
304
-18.5%
Maintainers
2
Weekly downloads
 
Created
Source

Combine Streams

NPM version Build status Test coverage Dependency Status License Downloads Gittip

Basically a streams2 version of combined-stream. Allows you to combine streams as well as strings and buffers into a single stream. Why? I don't know. I just saw this repo and thought, "hey, this sucks because it's not streams2".

Example

combine()
.append(fs.createReadStream('file1.txt'))
.append(fs.createReadStream('file2.txt'))
.append(null)
.pipe(process.stdout)

API

Combine([options])

Creates a new Combine instance. options are passed to require('stream').PassThrough.

var combine = require('combine-streams')

combine.append(obj)

You can append:

  • A readable stream
  • A buffer
  • A string
  • A thunk that returns one of the above

To signify that you are done appending items, you must call combine.append(null) just like a readable stream's .push(null) implementation.

combine()
.append(fs.createReadStream('file1.txt'))
.append('End of the first file.')
.append(function (done) {
  done(null, fs.createReadStream('file2.txt'))
})
.append('End of the second file.')
.append(null)
.pipe(process.stdout)

combine.pipe(dest [, options])

combine itself is a readable stream, so you should probably use combine.pipe(dest).

Keywords

concatenate

FAQs

Package last updated on 07 Dec 2014

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