1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
{
"name": "string-width",
"description": "Get the visual width of a string - the number of columns required to display it",
"dist-tags": {
"latest": "5.1.2",
"version4": "4.2.3"
},
"versions": {
"2.1.1": {
"name": "string-width",
"version": "2.1.1",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"dependencies": {
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
},
"gitHead": "74d8d552b465692790c41169b123409669d41079",
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"_id": "string-width@2.1.1",
"_npmVersion": "5.0.0",
"_nodeVersion": "8.0.0",
"dist": {
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e",
"tarball": "http://localhost:4260/string-width/string-width-2.1.1.tgz"
},
"directories": {}
},
"4.2.3": {
"name": "string-width",
"version": "4.2.3",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
},
"readme": "# string-width\n\n> Get the visual width of a string - the number of columns required to display it\n\nSome 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.\n\nUseful to be able to measure the actual width of command-line output.\n\n\n## Install\n\n```\n$ npm install string-width\n```\n\n\n## Usage\n\n```js\nconst stringWidth = require('string-width');\n\nstringWidth('a');\n//=> 1\n\nstringWidth('古');\n//=> 2\n\nstringWidth('\\u001B[1m古\\u001B[22m');\n//=> 2\n```\n\n\n## Related\n\n- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module\n- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string\n- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string\n\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n",
"readmeFilename": "readme.md",
"gitHead": "e7a2755c834246c59a4cc5de9471bef2d531a6b1",
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"_id": "string-width@4.2.3",
"_nodeVersion": "16.9.1",
"_npmVersion": "7.5.4",
"dist": {
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"shasum": "269c7117d27b05ad2e536830a8ec895ef9c6d010",
"tarball": "http://localhost:4260/string-width/string-width-4.2.3.tgz",
"fileCount": 5,
"unpackedSize": 5161
},
"directories": {},
"_hasShrinkwrap": false
},
"5.1.2": {
"name": "string-width",
"version": "5.1.2",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
},
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
},
"types": "./index.d.ts",
"gitHead": "9f90691968ad356c807aaad1a5ed98d795749932",
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"_id": "string-width@5.1.2",
"_nodeVersion": "12.22.1",
"_npmVersion": "8.3.2",
"dist": {
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"shasum": "14f8daec6d81e7221d2a357e668cab73bdbca794",
"tarball": "http://localhost:4260/string-width/string-width-5.1.2.tgz",
"fileCount": 5,
"unpackedSize": 5781
},
"directories": {},
"_hasShrinkwrap": false
}
},
"homepage": "https://github.com/sindresorhus/string-width#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"license": "MIT",
"readmeFilename": "readme.md"
}
|