1function ansiTrim (str) { 2 var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + 3 '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') 4 return str.replace(r, '') 5} 6 7module.exports = ansiTrim 8