1. add-stream
Append the contents of one stream onto another.
add-stream
Package: add-stream
Created by: wilsonjackson
Last modified: Mon, 13 Jun 2022 02:25:34 GMT
Version: 1.0.0
License: MIT
Downloads: 8,362,692
Repository: https://github.com/wilsonjackson/add-stream

Install

npm install add-stream
yarn add add-stream

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin