string-width
npmv8.2.2TypeScriptGet the visual width of a string - the number of columns required to display it
Overview
string-width is an npm package that get the visual width of a string - the number of columns required to display it. The latest version is 8.2.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need get the visual width of a string - the number of columns required to display it and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of string-width.
Dependencies
Runtime (2)
Dev (3)
Used by
Popular packages that depend on string-width.
Alternatives to string-width
Determine the East Asian Width of a Unicode character
Create clickable links in the terminal
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
Elegant terminal spinner
Get the line and column number of a specific character in a string
The tiniest and the fastest library for terminal output formatting with ANSI colors
Convert a string index to its line and column position
easily create complex multi-column command-line-interfaces
🌈Easily set your terminal text color & styles.
Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.
Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)
Strip UTF-8 byte order mark (BOM) from a string
Frequently installed together
TypeScript definitions for node
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
An AST-based pattern checker for JavaScript.
Like which(1) unix command. Find the first instance of an executable in the PATH.
A tiny (183B to 210B) and fast utility to ascend parent directories
TypeScript definitions for chai
Cross platform child_process#spawn and child_process#spawnSync
the bare-bones internationalization library used by yargs
easily create complex multi-column command-line-interfaces
the mighty option parser used by yargs
[](https://travis-ci.org/stefanpenner/get-caller-file) [](https://ci.a
Babel preset for TypeScript.
Version history
| Version | Published | License |
|---|---|---|
| 8.2.2latest | 12 days ago | MIT |
| 8.2.1 | 2 months ago | MIT |
| 8.2.0 | 5 months ago | MIT |
| 8.1.1 | 5 months ago | MIT |
| 8.1.0 | 10 months ago | MIT |
| 8.0.0 | 11 months ago | MIT |
| 7.2.0 | 2 years ago | MIT |
| 7.1.0 | 2 years ago | MIT |
| 7.0.0 | 2 years ago | MIT |
| 6.1.0 | 3 years ago | MIT |
| 6.0.0 | 3 years ago | MIT |
| 5.1.2 | 4 years ago | MIT |
| 5.1.1 | 4 years ago | MIT |
| 5.1.0 | 4 years ago | MIT |
| 4.2.3 | 4 years ago | MIT |
| 5.0.1 | 4 years ago | MIT |
| 5.0.0 | 5 years ago | MIT |
| 4.2.2 | 5 years ago | MIT |
| 4.2.1 | 5 years ago | MIT |
| 4.2.0 | 6 years ago | MIT |
Maintainers
Funding
Frequently asked questions
How do I install string-width?
Run `npm install string-width` to add string-width to your npm project.
What license is string-width released under?
string-width is distributed under the MIT license.
How popular is string-width?
string-width has approximately 0 downloads per week and 2 known dependent packages.