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@phong95/react-native-multiple-image-picker@ponchodien/react-native-printer-imin@positionex/position-sdkgenz-native-elementsfull-conventional-changelogframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newgaurav-react-native-loopgamification-integration-newdomaincomponentdotex-plugindogandev-simple-toasteasyplayer-myfiggerfawaterak-online-paymentfawatrak-online-paymentfixed_form_builderfluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphafmslfirebase-sign-in-with-ethereum@_nomtek/react-native-shimmer-animation@-xun/changelog@abhinavoneuipoc/stencil-test@praella/localisationist@buganto/client@cdk8s-extensions/argo-rollout@citycide/changelog@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@boundless-inc/mobiledoc-dom-renderer@brantalikp/rn-resizecandlelabssdkcheckbox-componentchangelog-sncapacitor-sim-pro
1.0.0

11 years ago