Home > @rushstack/terminal > PrintUtilities > wrapWordsToLines
PrintUtilities.wrapWordsToLines() method
Applies word wrapping and returns an array of lines.
Signature:
static wrapWordsToLines(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[]