breakword

Get index of character after which variable 'word' must be broken given variable 'length' (accounts for wide characters).

text-wrap-util

Flexible and versatile text wrapping JavaScript function that prioritizes existing line breaks within the text, supports custom break points, with the option of removing them or not from the text, and permits adding custom gutters or line prefixes.