Install
string-length
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
7.0.1Latest, 21 Jan 2026
298MDownloads, last month
0Advisories on the latest
0Advisories, all versions
MITLicence
172Stars
3.7/10OpenSSF Scorecard
Source · Homepage · Ask AI Mode · · Markdown
In the news
- Why Node.js HTTP backpressure must count bytes, not string length dev.to, 20 Nov 2026
- Your String Length Is a Lie: Four Unicode Traps in Everyday Code dev.to, 26 Oct 2026
- How Emoji Work Under the Hood: Code Points, ZWJ Sequences and Why String Length Lies dev.to, 24 Oct 2026
- javascript empty string length equals to 2 instead of 0 stackoverflow.com, 15 Nov 2024
- Mind-blowing: String length calculation in C dev.to, 23 Sep 2024
On Hacker News
- TIL the assumption that string length does not change when upper-cased is false 171 points, 240 comments, 22 Nov 2021
- String length functions for single emoji characters evaluate to greater than 1 116 points, 127 comments, 26 Mar 2021
- The best – but not good – way to limit string length 49 points, 44 comments, 30 Apr 2025
Sources: npm, deps.dev (CC BY 4.0), OSV. Last checked 4 Dec 2026.