Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « widest-line « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a9865d00abd9149033dd95ded2d60de67e4c8bf3 (plain)
1
2
3
4
5
6
7
8
'use strict';
const stringWidth = require('string-width');

module.exports = input => {
	let max = 0;
	for (const s of input.split('\n')) max = Math.max(max, stringWidth(s));
	return max;
};