string-width 8.x
Use string-width ^8.0.0 to calculate the terminal column width of strings, including Unicode, emoji, ANSI escape codes, ambiguous-width characters, tabs, and non-printing grapheme clusters.
- For
string-width@8.2.2- Verified
- 2026-09-08, 4 examples executed
- Package
@modootoday/pmcp-string-width@8.0.0
What it covers
- Runtime and module shape
- Basic width calculation
- Options
- `ambiguousIsNarrow`
- `countAnsiEscapeCodes`
- Unicode and grapheme behavior
- Common mistakes
- Not covered
One example from this skill
This is the skill's own text, not a summary of it. It runs: that is what verifying means here.
import assert from 'node:assert/strict';
import stringWidth from 'string-width';
assert.equal(stringWidth('a'), 1);
assert.equal(stringWidth('hello'), 5);
assert.equal(stringWidth('古'), 2);
assert.equal(stringWidth('古a'), 3);
assert.equal(stringWidth('\t'), 0);
assert.equal(stringWidth('\n'), 0);
What it did in the sandbox
Verifying this skill meant installing the package and running code against it with no route out. Nothing was observed. The full ledger lists every package examined, including the ones that never became a skill.
Nothing observed is not a finding of safety. It means one run, under one policy, produced nothing to report.
Getting it
With a subscription:
npx -y @modootoday/pmcp login
npx -y @modootoday/pmcp install @modootoday/pmcp-string-width
It installs as a dev dependency of your project, and the MCP server finds it there like any other skill.