Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/terminal > PrintUtilities > wrapWords

PrintUtilities.wrapWords() method

Applies word wrapping.

Signature:

static wrapWords(text: string, maxLineLength?: number, linePrefix?: string): string;

Parameters

Parameter

Type

Description

text

string

The text to wrap

maxLineLength

number

(Optional) The maximum length of a line, defaults to the console width

linePrefix

string

(Optional) The string to prefix each line with, defaults to ''

Returns:

string