• File: index.js
  • Full Path: /var/www/nodejs/daily_store_reports_nodejs/node_modules/widest-line/index.js
  • Date Modified: 02/04/2023 9:31 PM
  • File size: 322 bytes
  • MIME-type: text/plain
  • Charset: utf-8
'use strict';
const stringWidth = require('string-width');

const widestLine = input => {
	let max = 0;

	for (const line of input.split('\n')) {
		max = Math.max(max, stringWidth(line));
	}

	return max;
};

module.exports = widestLine;
// TODO: remove this in the next major version
module.exports.default = widestLine;