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-react@praella/localisationist@positionex/position-sdkjrennsoh88-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@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@citycide/changelog@-xun/changelog@happy-gastro/react-native-printer-module@abhinavoneuipoc/stencil-test@_nomtek/react-native-shimmer-animation@ahmed_shaban123/react-native-currencyinput@adatechnology/react-native-android-getnet-pos@adembacaj/react-native-google-pay@con-test/react-native-concent-common@ali5049/react-native-buttons@corelmax/react-native-my2c2p-sdk@amirdiafi/react-native-ios-haptics@hbglobal/react-native-actions-shortcuts@amiruldev/wajsjawwy_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-commitizen@buganto/client@brantalikp/rn-resize@cdk8s-extensions/argo-rollout@boundless-inc/mobiledoc-dom-rendereryarn-react-hook-formywhskdjafziu
1.0.0

11 years ago