@cto.af/linewrap - v5.0.2
    Preparing search index...

    Class LineWrap

    Index
    DEFAULT_OPTIONS: Required<LineWrapOptions> = ...
    OVERFLOW_ANYWHERE: typeof OVERFLOW_ANYWHERE = OVERFLOW_ANYWHERE

    If a word is longer than the wrappable area, split it into chunks that do fit, inserting a hyphen at the end of each line.

    OVERFLOW_CLIP: typeof OVERFLOW_CLIP = OVERFLOW_CLIP

    If a word is longer than the wrappable area, cut it to size, dropping the rest of the word, inserting an ellipsis at the end.

    OVERFLOW_VISIBLE: typeof OVERFLOW_VISIBLE = OVERFLOW_VISIBLE

    If a word is longer than the wrappable area, allow the word to go extend past the width so that it is not broken. This is the only way for long URLs to still be clickable.

    • get isCJK(): boolean

      Did we determin that we are in a CJK context? Useful for testing.

      Returns boolean

    • get locale(): Locale

      The calculated locale. Useful for testing.

      Returns Locale

    • Yield a succession of lines that fit, as best as possible, into the possible width configured. Lines will not have newlines appended, but will be indented.

      Parameters

      • text: string

        The input string

      • OptionalfirstCol: number = NaN

        If not NaN, use this column as the start in addition to the firstCol option (if it was non-NaN).

      Returns Generator<string, void, undefined>

    • Yield a succession of lines that fit, as best as possible, into the possible width configured. Lines will not have newlines appended, but will be indented. Each line will yield a Part object.

      Parameters

      • text: string

        The input string

      • OptionalfirstCol: number = NaN

        If not NaN, use this column as the start in addition to the firstCol option (if it was non-NaN).

      Returns Generator<Part, void, undefined>

    • Unwrap text using the isNewline and newlineReplacement options.

      Parameters

      • text: string

      Returns string

    • Wrap text, inserting a newline between each line. No newline added at the end.

      Parameters

      • text: string

      Returns string