string-length

String counter

Corrects string length counting by ignoring astral symbols and ANSI escape codes.

Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes

GitHub

162 stars
9 watching
11 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-width Calculates the visual width of a string based on its Unicode characters and formatting options 479
sindresorhus/strip-indent Removes redundant indentation from a string by finding the minimum leading whitespace across all lines. 135
sindresorhus/cli-truncate Library to truncate strings to fit terminal widths 85
sindresorhus/leven A JavaScript implementation of the Levenshtein distance algorithm for measuring string similarity. 715
sindresorhus/filled-array Creates an array of specified length filled with a given value or function returning values 43
sindresorhus/pretty-bytes Converts bytes to human-readable strings 1,113
sindresorhus/pretty-bytes-cli Converts bytes to a human-readable string representation. 68
sindresorhus/get-stdin A utility module to retrieve input from standard input as a string or buffer 337
sindresorhus/p-reduce Transforms an asynchronous list into a single value by applying a reduction function 68
sindresorhus/indent-string A utility function to insert consistent indentation into a string 112
sindresorhus/strip-bom Removes the UTF-8 byte order mark from strings 111
sindresorhus/escape-string-regexp Escapes special characters in regular expressions to ensure safe string insertion 582
sindresorhus/decamelize Converts camel-cased strings into lowercased ones with a custom separator 238
sindresorhus/round-to A utility library for rounding numbers to specific decimal places 155
sindresorhus/matcher A utility for simple string matching with wildcard patterns 537