nx.js
Interfaces

ConsoleOptions

Options for a Console. In addition to the optional print/printErr sinks, the canvas-backed terminal can be styled via TerminalOptions (theme colors, font size, scrollback, cursor, etc.).

For the global console, assign these options to Console.options before the first output (e.g. at the top of your app) — the underlying terminal is created lazily, so the options take effect on first render:

console.options = {
  fontSize: 24,
  theme: { background: '#002b36', foreground: '#839496' },
};

Extends

Properties

PropertyTypeDescriptionInherited from
cursorOpacity?numberOpacity of the cursor, 0-1. Default 0.5TerminalOptions.cursorOpacity
cursorStyle?CursorStyleCursor shape. Default 'block'TerminalOptions.cursorStyle
fontSize?numberFont size in pixels. Default 20TerminalOptions.fontSize
height?numberHeight of the backing canvas in pixels. Default 720TerminalOptions.height
lineHeight?numberLine height as a multiple of the font size. Default 1.25TerminalOptions.lineHeight
scrollback?numberScrollback buffer size (rows). Default 1000TerminalOptions.scrollback
theme?ConsoleThemeColor theme. In addition to background / foreground / cursor, the full ANSI palette (black..brightWhite) is honored.TerminalOptions.theme
width?numberWidth of the backing canvas in pixels. Default 1280TerminalOptions.width

Methods

print()?

optional print(s): void

Parameters

ParameterType
sstring

Returns

void


printErr()?

optional printErr(s): void

Parameters

ParameterType
sstring

Returns

void

On this page