🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

widest-line

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

widest-line - npm Package Compare versions

Comparing version

to
2.0.0

8

index.js
'use strict';
var stringWidth = require('string-width');
const stringWidth = require('string-width');
module.exports = function (str) {
return Math.max.apply(null, str.split('\n').map(function (x) {
return stringWidth(x);
}));
};
module.exports = input => Math.max.apply(null, input.split('\n').map(x => stringWidth(x)));
{
"name": "widest-line",
"version": "1.0.0",
"version": "2.0.0",
"description": "Get the visual width of the widest line in a string - the number of columns required to display it",

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

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -49,3 +49,3 @@ "scripts": {

"dependencies": {
"string-width": "^1.0.1"
"string-width": "^2.1.1"
},

@@ -52,0 +52,0 @@ "devDependencies": {

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

```
$ npm install --save widest-line
$ npm install widest-line
```

@@ -23,3 +23,3 @@

widestLine('古\n\u001b[1m@\u001b[22m');
widestLine('古\n\u001B[1m@\u001B[22m');
//=> 2

@@ -36,2 +36,2 @@ ```

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet