RoadmapShopEvents
Skip to main content

Home > @rushstack/terminal

terminal package

This library implements a system for processing human readable text that will be output by console applications.

Remarks

See the TerminalWritable documentation for an overview of the major concepts.

Classes

ClassDescription
CallbackWritableThis class enables very basic TerminalWritable.onWriteChunk() operations to be implemented as a callback function, avoiding the need to define a subclass of TerminalWritable.
DiscardStdoutTransform(BETA) DiscardStdoutTransform discards stdout chunks while fixing up malformed stderr lines.
MockWritable(BETA) A TerminalWritable subclass for use by unit tests.
NormalizeNewlinesTextRewriterFor use with TextRewriterTransform , this rewriter converts all newlines to a standard format.
PrintUtilitiesA collection of utilities for printing messages to the console.
RemoveColorsTextRewriterFor use with TextRewriterTransform , this rewriter removes ANSI escape codes including colored text.
SplitterTransformUse this instead of TerminalTransform if you need to output ITerminalChunk data to more than one destination.
StderrLineTransform(BETA) StderrLineTransform normalizes lines that mix characters from stdout and stderr, so that each output line is routed entirely to stdout or stderr.
StdioSummarizer(BETA) Summarizes the results of a failed build task by returning a subset of stderr output not to exceed a specified maximum number of lines.
StdioWritableA TerminalWritable subclass that writes its output directly to the process stdout and stderr streams.
TerminalTransformThe abstract base class for TerminalWritable objects that receive an input, transform it somehow, and then write the output to another TerminalWritable.
TerminalWritableThe abstract base class for objects that can present, route, or process text output for a console application. This output is typically prepared using the Terminal API.
TextRewriterThe abstract base class for operations that can be applied by TextRewriterTransform .
TextRewriterTransformA TerminalTransform subclass that performs one or more TextRewriter operations. The most common operations are NormalizeNewlinesTextRewriter and RemoveColorsTextRewriter .

Enumerations

EnumerationDescription
TerminalChunkKindSpecifies the kind of data represented by a ITerminalChunk object.

Interfaces

InterfaceDescription
ICallbackWritableOptionsConstructor options for CallbackWritable .
IDiscardStdoutTransformOptions(BETA) Constructor options for DiscardStdoutTransform
INormalizeNewlinesTextRewriterOptionsConstructor options for NormalizeNewlinesTextRewriter
ISplitterTransformOptionsConstructor options for SplitterTransform .
IStdioLineTransformOptions(BETA) Constructor options for StderrLineTransform
IStdioSummarizerOptions(BETA) Constructor options for StdioSummarizer .
ITerminalChunkRepresents a chunk of output that will ultimately be written to a TerminalWritable .
ITerminalTransformOptionsConstructor options for TerminalTransform .
ITerminalWritableOptionsConstructor options for TerminalWritable
ITextRewriterTransformOptionsConstructor options for TextRewriterTransform .

Variables

VariableDescription
DEFAULT_CONSOLE_WIDTHA sensible fallback column width for consoles.

Type Aliases

Type AliasDescription
TextRewriterStateRepresents the internal state of a TextRewriter subclass.