node-progress
node-progress copied to clipboard
ANSI colors not supported in the format
Hello, the width is not computed correctly when ansi colors are used
https://github.com/tj/node-progress/blob/master/lib/node-progress.js#L139
ansi-regex should be considered, something like that
var ansiRegex = require('ansi-regex');
var availableSpace = Math.max(0, this.stream.columns - str.replace(ansiRegex(), '').replace(':bar', '').length);
Happy to review a PR!