1.0.0 • Published 11 years ago

add-stream v1.0.0

Weekly downloads
466,019
License
MIT
Repository
github
Last release
11 years ago

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

conventional-changelog-coreeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imageairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdk@jttechnic/interpreterreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutils@oiti/documentoscopy-react-nativequoc-testluminos-ui-core@everything-registry/sub-chunk-1097jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplegriffin-ui-librarytailwind-vector-effecttest-library-123test-haptik-libwinx-form-winxwifi_configuration_packagetest-zeo-collectvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libkhaled-salem-custom-componentslazy-bee-uiiiif-manifest-editorimocksicommitgulp-conventional-changeloghong1-utilsheroicdefenselogbaseluojia-cli-dev@wecraftapps/react-native-use-keyboard@tlgeo/react-native-gdal@thinxviewx/core-rn@yplabs-ltd/react-native-detector@xus/preset-built-in@zcong/js-release@zotasys/nativeagent-get-agentadyen-rnawesome-module-kdastra-ufo-sdkarchlibrary@happy-gastro/react-native-printer-module@hbglobal/react-native-actions-shortcutsjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarquickcapture_react_nativesushi-sdk-ftmrn-agora-ios-mzzzxxxyyy321123react-native-omental-frameworkreact-native-sixdee_test_libtrs-commitizenyarn-react-hook-formywhskdjafziu@labiebhn_/react-native-multiplier@lordbeanbag/vite-plugin-svg-icons-monorepo@latiwesh/conventional-changelog-core@lehuyaa/my-assetsmpd-parser-1my-tools-climiracle-webpack-tree-shakingmobilifymongo-sites-apinative-apple-loginnative-kakao-loginnative-google-loginnative-date-picker-modulenative-modal-damage-vehicleori-bot-react-nativenpm_qwertynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2payutesting
1.0.0

11 years ago