interface
StringWidthOptions
interface StringWidthOptions
- ambiguousIsNarrow?: boolean
If
true, count ambiguous-width characters as 1 character wide. Iffalse, count them as 2 characters wide. - countAnsiEscapeCodes?: boolean
If
true, count ANSI escape codes as part of the string width. Iffalse, ignore them. - perCodePoint?: boolean
If
true, measure every Unicode code point individually (East Asian Width plus emoji presentation, the algorithm Node.js uses forconsole.tableandutil.inspectalignment), so each member of an emoji ZWJ sequence is counted:"π¨βπ©βπ§βπ¦"measures 8. Iffalse, emoji sequences and other grapheme clusters count once:"π¨βπ©βπ§βπ¦"measures 2.