Get line length of a string
lineLength('aaaaaaaa\naaaaaaaaaaaaaaaaaaaa\r\naaaaaa\n'); //=> [8, 20, 6, 0]npm install line-length
bower install line-length
const lineLength = require('shinnn/line-length.js');Download the script file directly.
string: String
Return: Array of Number
It returns an array of line length. "Line" means each part of a string splitted by \n and \r\n.
lineLength('foo'); //=> [3]
lineLength('\n'); //=> [0, 0]
lineLength(''); //=> [0]Copyright (c) 2014 - 2015 Shinnosuke Watanabe
Licensed under the MIT License.