1.0.1 • Published 10 years ago
max-line-length v1.0.1
max-line-length.js
Get maximum line length of a string
maxLineLength('aaaaaaaa\naaaaaaaaaaaaaaaaaa\r\naaaa\n'); //=> 18Installation
Package managers
npm
npm install max-line-lengthBower
bower install max-line-lengthStandalone
Download the script file and its dependency.
API
maxLineLength(string)
string: String
Return: Array of Number
It returns length of the longest line in a string. "Line" means each part of a string splitted by \n and \r\n.
maxLineLength('one\nanother'); //=> 7
maxLineLength('\r\n'); //=> 0
maxLineLength(''); //=> 0