Skip to main content

wrapAnsi

Callable

  • wrapAnsi(text: string, width: number, options?: WrapOptions): string

  • Wrap a string that contains ANSI escape codes to a desired terminal width. Based on wrap-ansi.

    import { wrapAnsi } from '@boost/terminal';

    const text = wrapAnsi(aStringThatContainsAnsi, 20);