RoadmapShopEvents
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

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the SplitterTransform class

Properties

PropertyModifiersTypeDescription
destinationsreadonlyReadonlyArray<TerminalWritable>
isOpenreadonlyboolean

This property is initially true when the object is constructed, and becomes false when close() is called.

(Inherited from TerminalWritable)

preventAutoclosereadonlyboolean(Inherited from TerminalWritable)

Methods

MethodModifiersDescription
close()

Calling this method flushes any remaining outputs and permanently transitions the TerminalWritable to a "closed" state, where no further chunks can be written.

(Inherited from TerminalWritable)

onClose()protected
onWriteChunk(chunk)protected
writeChunk(chunk)

Upstream objects call this method to provide inputs to this object.

(Inherited from TerminalWritable)