@tempots/std

wrapColumns() function

wrapColumns splits a long string into lines that are at most columns long. Individual words whose length exceeds columns are not split.

Signature:

wrapColumns: (s: string, columns?: number, indent?: string, newline?: string) => string

Parameters

Parameter

Type

Description

s

string

The string to wrap.

columns

number

(Optional) The number of columns per line.

indent

string

(Optional) The indentation string to prepend to each line.

newline

string

(Optional) The newline character to use for line breaks.

Returns: string

The wrapped string.