Socket
Socket
Sign inDemoInstall

add-stream

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-stream

Append the contents of one stream onto another.


Version published
Maintainers
1
Weekly downloads
1,985,150
decreased by-5.37%

Weekly downloads

Readme

Source

add-stream Build Status

Append the contents of one stream onto another.

Usage

var fs = require('fs');
var es = require('event-stream');
var addStream = require('add-stream');

// Append strings/buffers
fs.createReadStream('1.txt') // 1.txt contains: number1
	.pipe(addStream(fs.createReadStream('2.txt'))) // 2.txt contains: number2
	.pipe(fs.createWriteStream('appended.txt')); // appended.txt contains: number1number2

// Append object streams
es.readArray([1, 2, 3])
	.pipe(addStream.obj(es.readArray([4, 5, 6])))
	.pipe(es.writeArray(function (err, array) {
		console.log(array); // [ 1, 2, 3, 4, 5, 6 ]
	}));

API

var transformStream = addStream(stream, opts = {})

Create a transform stream that appends the contents of stream onto whatever is piped into it. Options are passed to the transform stream's constructor.

var transformStream = addStream.obj(stream, opts = {})

A convenient shortcut for addStream(stream, {objectMode: true}).

License

MIT

Keywords

FAQs

Last updated on 06 Dec 2014

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