Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
sindresorhus
/
string-width
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
44
Star
527
Code
Issues
1
Pull requests
1
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Commits
Branch selector
main
User selector
All users
Datepicker
All time
Commit history
Commits on Jul 8, 2026
8.2.2
sindresorhus
committed
64dc20c
View commit details
Copy full SHA for 64dc20c
Browse repository at this point
Add one more test
sindresorhus
committed
13d4efd
View commit details
Copy full SHA for 13d4efd
Browse repository at this point
Fix spacing mark width handling (#80)
TheAlexLichter
authored
b62c9ea
View commit details
Copy full SHA for b62c9ea
Browse repository at this point
Commits on Apr 27, 2026
8.2.1
sindresorhus
committed
cf857c1
View commit details
Copy full SHA for cf857c1
Browse repository at this point
Commits on Apr 26, 2026
Fix Hangul grapheme width handling
Show description for 9781ea4
sindresorhus
committed
9781ea4
View commit details
Copy full SHA for 9781ea4
Browse repository at this point
Commits on Feb 18, 2026
8.2.0
sindresorhus
committed
7c2f550
View commit details
Copy full SHA for 7c2f550
Browse repository at this point
Meta tweaks
sindresorhus
committed
8b6dc2f
View commit details
Copy full SHA for 8b6dc2f
Browse repository at this point
Improve performance with ASCII fast path (#72)
privatenumber
authored
91b9857
View commit details
Copy full SHA for 91b9857
Browse repository at this point
Commits on Feb 15, 2026
Fix width calculation for minimally-qualified emoji sequences (#68)
Show description for 28147cc
sindresorhus
authored
28147cc
View commit details
Copy full SHA for 28147cc
Browse repository at this point
Commits on Jan 29, 2026
8.1.1
sindresorhus
committed
d3bd086
View commit details
Copy full SHA for d3bd086
Browse repository at this point
Fix crash on Unicode Format characters like U+0600
Show description for 7626ac3
sindresorhus
committed
7626ac3
View commit details
Copy full SHA for 7626ac3
Browse repository at this point
Commits on Sep 1, 2025
8.1.0
sindresorhus
committed
42e7b69
View commit details
Copy full SHA for 42e7b69
Browse repository at this point
Add more tests and simplify implementation
Show description for bf041e0
sindresorhus
committed
bf041e0
View commit details
Copy full SHA for bf041e0
Browse repository at this point
Improve `isDoubleWidthEmojiCluster` (#65)
fisker
authored
8691a94
View commit details
Copy full SHA for 8691a94
Browse repository at this point
Commits on Aug 22, 2025
8.0.0
sindresorhus
committed
68f54fe
View commit details
Copy full SHA for 68f54fe
Browse repository at this point
Require Node.js 20 and improve logic
Show description for fbea7e5
sindresorhus
committed
fbea7e5
View commit details
Copy full SHA for fbea7e5
Browse repository at this point
Commits on Jun 30, 2024
7.2.0
sindresorhus
committed
ac09208
View commit details
Copy full SHA for ac09208
Browse repository at this point
Handle more edge-cases
Show description for be33439
sindresorhus
committed
be33439
View commit details
Copy full SHA for be33439
Browse repository at this point
Commits on Mar 10, 2024
Meta tweaks
sindresorhus
committed
94ad7e1
View commit details
Copy full SHA for 94ad7e1
Browse repository at this point
Commits on Jan 22, 2024
7.1.0
sindresorhus
committed
8e3727e
View commit details
Copy full SHA for 8e3727e
Browse repository at this point
Meta tweaks
sindresorhus
committed
379e334
View commit details
Copy full SHA for 379e334
Browse repository at this point
Improve performance (#54)
H4ad
authored
b0dd0fa
View commit details
Copy full SHA for b0dd0fa
Browse repository at this point
Commits on Oct 28, 2023
7.0.0
sindresorhus
committed
210a997
View commit details
Copy full SHA for 210a997
Browse repository at this point
Require Node.js 18 and use more recent Unicode data
Show description for 97b50e8
sindresorhus
committed
97b50e8
View commit details
Copy full SHA for 97b50e8
Browse repository at this point
Commits on May 6, 2023
6.1.0
sindresorhus
committed
f6e70c4
View commit details
Copy full SHA for f6e70c4
Browse repository at this point
Improve performance (#49)
fisker
authored
fe356d8
View commit details
Copy full SHA for fe356d8
Browse repository at this point
6.0.0
sindresorhus
committed
102c82c
View commit details
Copy full SHA for 102c82c
Browse repository at this point
Meta tweaks
sindresorhus
committed
c4c8062
View commit details
Copy full SHA for c4c8062
Browse repository at this point
Add `countAnsiEscapeCodes` option (#48)
fisker
authored
6e6993b
View commit details
Copy full SHA for 6e6993b
Browse repository at this point
Commits on May 5, 2023
Use `Intl.Segmenter`, require Node.js v16 (#47)
fisker
authored
f85812f
View commit details
Copy full SHA for f85812f
Browse repository at this point
Commits on Feb 28, 2022
5.1.2
sindresorhus
committed
9f90691
View commit details
Copy full SHA for 9f90691
Browse repository at this point
Use `for..of` loop (#40)
fisker
authored
2fe6df9
View commit details
Copy full SHA for 2fe6df9
Browse repository at this point
Add test for #2 (#39)
fisker
authored
8b84b9b
View commit details
Copy full SHA for 8b84b9b
Browse repository at this point
Commits on Feb 27, 2022
5.1.1
sindresorhus
committed
d0d53da
View commit details
Copy full SHA for d0d53da
Browse repository at this point
Fix incorrect default for `ambiguousIsNarrow` option
Show description for 483baa1
sindresorhus
committed
483baa1
View commit details
Copy full SHA for 483baa1
Browse repository at this point
Previous
Next
You can’t perform that action at this time.