longest-length
Get the length of the longest word in a string. It also correctly calculates the length of the words containing ANSI escape codes and astral symbols.
Install
$ npm install --save longest-length
Usage
var longestLength = ; //=> 34 //=> 5 //=> 3
API
longestLength(input, [options])
input
Required
Type: string
options
stripAnsiCodes
Type: boolean
Default: true
Get the real length of a string.
splitRegex
Type: regex
Default: /\S+/g
Regex used to split text in words.
License
MIT © Danilo Sampaio