UNPKG

tty-strings

Version:

Tools for working with strings displayed in the terminal

15 lines 418 B
/** * Get the visual width of a string. ANSI escape codes will be ignored. * * @example * ```ts * import { stringWidth } from 'tty-strings'; * * const width = stringWidth('🧑🏻‍🤝‍🧑🏼'); // 2 * ``` * * @param string - Input string to measure. * @returns The visual width of the string. */ export default function stringWidth(string: string): number; //# sourceMappingURL=stringWidth.d.ts.map