Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/terminal > SplitterTransform

SplitterTransform class

Use this instead of TerminalTransform if you need to output ITerminalChunk data to more than one destination.

Signature:

export declare class SplitterTransform extends TerminalWritable 

Extends: TerminalWritable

Remarks

Splitting streams complicates the pipeline topology and can make debugging more difficult. For this reason, it is modeled as an explicit SplitterTransform node, rather than as a built-in feature of TerminalTransform.

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Constructs a new instance of the SplitterTransform class

Properties

Property

Modifiers

Type

Description

destinations

readonly

ReadonlySet<TerminalWritable>

Methods

Method

Modifiers

Description

addDestination(destination)

Adds a destination to the set of destinations. Duplicates are ignored. Only new chunks received after the destination is added will be sent to it.

onClose()

protected

onWriteChunk(chunk)

protected

removeDestination(destination, close)

Removes a destination from the set of destinations. It will no longer receive chunks, and will be closed, unless destination.preventAutoclose is set to true.