linegauge
Measures, wraps, truncates and slices styled terminal text, grapheme-correct over Intl.Segmenter, with the same result on a terminal, a pipe or --json. Zero dependencies. Drop-in paths for string-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line.
Read the docsComing from slice-ansiComing from string-widthComing from strip-ansiComing from wrap-ansi
Part of the burgee family, graded against its incumbents on the compatibility page and drawn in the gallery.