
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
display-width
Advanced tools
A node.js port of [uwcwidth](https://github.com/Z4JC/uwcwidth), a fast function for determining a string's display width
A node.js port of uwcwidth, a fast function for determining a string's display width
That code is a port of POSIX wcswidth, a standard function for counting the number of columns occupied by a string, and is derived from musl libc
import { wcswidth } from "display-width";
// wcswidth("👩❤️👨") == 2
console.log(wcswidth("\u{1F469}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{1F468}"));
>> wcswidth("café") == 4
>> "café".length == 5
>> wcswidth("⚠︎ warning") == 9
>> "⚠︎ warning".length == 10
>> wcswidth("👨👨👧👧") == 2
>> "👨👨👧👧".length == 11
>> wcswidth("👩❤️👨") == 2
>> "👩❤️👨".length == 8
yes! Compared to string-width, it's about 33x faster
┌─────────┬─────────────────┬───────────┬────────────────────┬───────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼─────────────────┼───────────┼────────────────────┼───────────┼─────────┤
│ 0 │ 'display-width' │ '188,426' │ 5307.115321339439 │ '±1.55%' │ 18843 │
│ 1 │ 'string-width' │ '5,586' │ 179008.73345259373 │ '±11.73%' │ 559 │
└─────────┴─────────────────┴───────────┴────────────────────┴───────────┴─────────┘
see the bench directory for details
no!
no!
no! I ported the code and all the tests from uwcwidth though, so I have good vibes about it
FAQs
A node.js port of [uwcwidth](https://github.com/Z4JC/uwcwidth), a fast function for determining a string's display width
We found that display-width demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.