You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

string-width

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-width - npm Package Compare versions

Comparing version
2.0.0
to
2.1.0
+3
-3
index.js

@@ -17,8 +17,8 @@ 'use strict';

// ignore control characters
if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
// Ignore control characters
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
continue;
}
// surrogates
// Surrogates
if (code >= 0x10000) {

@@ -25,0 +25,0 @@ i++;

{
"name": "string-width",
"version": "2.0.0",
"version": "2.1.0",
"description": "Get the visual width of a string - the number of columns required to display it",

@@ -49,3 +49,3 @@ "license": "MIT",

"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^3.0.0"
"strip-ansi": "^4.0.0"
},

@@ -55,6 +55,3 @@ "devDependencies": {

"xo": "*"
},
"xo": {
"esnext": true
}
}

@@ -5,3 +5,3 @@ # string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)

Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.

@@ -14,3 +14,3 @@ Useful to be able to measure the actual width of command-line output.

```
$ npm install --save string-width
$ npm install string-width
```

@@ -17,0 +17,0 @@

Sorry, the diff of this file is not supported yet