Gathering detailed insights and metrics for @innei/string-width
Gathering detailed insights and metrics for @innei/string-width
Gathering detailed insights and metrics for @innei/string-width
Gathering detailed insights and metrics for @innei/string-width
Get the visual width of a string - the number of columns required to display it
npm install @innei/string-width
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72
Supply Chain
87.1
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (95.28%)
TypeScript (4.72%)
Total Downloads
41,678
Last Day
23
Last Week
83
Last Month
1,332
Last Year
27,493
MIT License
492 Stars
65 Commits
32 Forks
11 Watchers
1 Branches
13 Contributors
Updated on Jun 29, 2025
Minified
Minified + Gzipped
Latest Version
7.1.1-fork.0
Package Id
@innei/string-width@7.1.1-fork.0
Unpacked Size
118.68 kB
Size
24.17 kB
File Count
9
NPM Version
10.2.4
Node Version
18.18.0
Published on
May 27, 2024
Cumulative downloads
Total Downloads
Last Day
91.7%
23
Compared to previous day
Last Week
-52.6%
83
Compared to previous week
Last Month
145.8%
1,332
Compared to previous month
Last Year
93.8%
27,493
Compared to previous year
7
Get the visual width of a string - the number of columns required to display it
Some Unicode characters are fullwidth and use double the normal width. ANSI escape codes are stripped and doesn't affect the width.
Useful to be able to measure the actual width of command-line output.
1npm install string-width
1import stringWidth from 'string-width'; 2 3stringWidth('a'); 4//=> 1 5 6stringWidth('古'); 7//=> 2 8 9stringWidth('\u001B[1m古\u001B[22m'); 10//=> 2
Type: string
The string to be counted.
Type: object
Type: boolean
Default: true
Count ambiguous width characters as having narrow width (count of 1) instead of wide width (count of 2).
Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). If the context cannot be established reliably, they should be treated as narrow characters by default.
Type: boolean
Default: false
Whether ANSI escape codes should be counted.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More