string-width

String width calculator

Calculates the visual width of a string based on its Unicode characters and formatting options

Get the visual width of a string - the number of columns required to display it

GitHub

479 stars
12 watching
31 forks
Language: JavaScript
last commit: 5 months ago
Linked from 1 awesome list


Backlinks from these awesome lists:

Related projects:

Repository Description Stars
sindresorhus/string-length Corrects string length counting by ignoring astral symbols and ANSI escape codes. 162
sindresorhus/cli-truncate Library to truncate strings to fit terminal widths 85
sindresorhus/image-dimensions Gets dimensions of images in various formats without loading the entire image data 431
sindresorhus/pretty-bytes Converts bytes to human-readable strings 1,113
sindresorhus/leven A JavaScript implementation of the Levenshtein distance algorithm for measuring string similarity. 715
sindresorhus/pretty-bytes-cli Converts bytes to a human-readable string representation. 68
sindresorhus/yn A utility for parsing yes/no like values with optional typo tolerance 266
sindresorhus/strip-indent Removes redundant indentation from a string by finding the minimum leading whitespace across all lines. 135
sindresorhus/indent-string A utility function to insert consistent indentation into a string 112
sindresorhus/hasha A utility module for computing and manipulating hashes of various types of input data 957
sindresorhus/get-stdin A utility module to retrieve input from standard input as a string or buffer 337
sindresorhus/globals Provides a list of global variables from different JavaScript environments. 405
sindresorhus/round-to A utility library for rounding numbers to specific decimal places 155
sindresorhus/indent-string-cli A command-line tool for indenting lines of text 5
sindresorhus/pokemon A module that provides access to Pokémon names and IDs in various languages. 490