push-stream-std

@push-stream-std/push-cat (0.0.9)

Published 2026-07-21 03:57:28 +00:00 by Dvorak

Installation

@push-stream-std:registry=https://hub.kl1.tenere.ai/api/packages/push-stream-std/npm/
npm install @push-stream-std/push-cat@0.0.9
"@push-stream-std/push-cat": "0.0.9"

About this package

@push-stream-std/push-cat

Concatenate multiple push streams sequentially.

Published as @push-stream-std/push-cat.

Synopsis

import { cat } from '@push-stream-std/push-cat';

const source1 = /* push stream producing 1, 2, 3 */;
const source2 = /* push stream producing 4, 5, 6 */;

cat([source1, source2]).pipe(sink);

// Output: 1, 2, 3, 4, 5, 6

Install

npm config set @push-stream-std:registry https://hub.kl1.tenere.ai/api/packages/push-stream-std/npm/
npm config set -- //hub.kl1.tenere.ai/api/packages/push-stream-std/npm/:_authToken "$PACKAGE_TOKEN"
npm install @push-stream-std/push-cat

Why

Creates a source stream that reads from multiple push streams in order, moving to the next source when the current one ends. Useful for chaining follow-up streams, e.g. a paginated API fetch. Aborting the combined stream aborts the current source and skips all remaining sources.

API

cat(sources)

Creates a concatenated source stream.

  • sources Array | ...arguments – An array of push-stream sources, or passed as individual rest arguments. Null entries are skipped.
  • Returns A source stream with pipe(), resume(), abort(), paused, and ended. For an empty sources array, returns a stream that ends immediately.

cat.createEmptyCat()

Returns a source stream that immediately ends when piped. Used internally for the empty-sources case.

createEmptyCat()

Same as cat.createEmptyCat. Also exported as a named export.

Tests

npm test

Tests cover concatenating two and three sources, handling an empty sources array, accepting sources as rest arguments, and skipping null entries in the sources array.

Requirements

Node.js 22 or later. ESM only.

Dependencies

Dependencies

ID Version
@push-stream-std/push-stream-base *

Keywords

push-stream stream cat concat combine
Details
npm
2026-07-21 03:57:28 +00:00
1
SEE LICENSE IN LICENSE
latest
4.2 KiB
Assets (1)
Versions (6) View all
0.0.9 2026-07-21
0.0.8 2026-07-20
0.0.7 2026-07-20
0.0.6 2026-07-19
0.0.4 2026-07-19