benji.monster/node_modules/widest-line/index.js

9 lines
191 B
JavaScript
Raw Normal View History

2020-01-03 20:48:09 +00:00
'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;
};