chalk/wrap-ansi
The issue has been solved
Off by one if trimming is disabled #25
watson posted onGitHub
If trimming is disabled, and you're wrapping a text a say length 3, and there's a whitespace right where the wrap should occur, the whitespace remains and the line break is appended to it. This results in the line being one char too long:
console.log(JSON.stringify(trim('foo bar', 3))) // => "foo\nbar"
console.log(JSON.stringify(trim('foo bar', 3, {trim: false}))) // => "foo \nbar"