Socket
Socket
Sign inDemoInstall

widest-line

Package Overview
Dependencies
5
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 3.0.0

index.d.ts

11

index.js
'use strict';
const stringWidth = require('string-width');
module.exports = input => {
const widestLine = input => {
let max = 0;
for (const s of input.split('\n')) max = Math.max(max, stringWidth(s));
for (const line of input.split('\n')) {
max = Math.max(max, stringWidth(line));
}
return max;
};
module.exports = widestLine;
module.exports.default = widestLine;

104

package.json
{
"name": "widest-line",
"version": "2.0.1",
"description": "Get the visual width of the widest line in a string - the number of columns required to display it",
"license": "MIT",
"repository": "sindresorhus/widest-line",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"string",
"str",
"character",
"char",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width"
],
"dependencies": {
"string-width": "^2.1.1"
},
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "widest-line",
"version": "3.0.0",
"description": "Get the visual width of the widest line in a string - the number of columns required to display it",
"license": "MIT",
"repository": "sindresorhus/widest-line",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd-check"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"string",
"character",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width"
],
"dependencies": {
"string-width": "^4.0.0"
},
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.5.0",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc