title: Remove all ANSI colors/styles from strings
body: <p>I <a href="https://github.com/IonicaBizau/couleurs">use a library</a> that adds ANSI colors / styles to strings. For example:</p>
  
  <pre><code>&gt; "Hello World".rgb(255, 255, 255)
  '\u001b[38;5;231mHello World\u001b[0m'
  &gt; "Hello World".rgb(255, 255, 255).bold()
  '\u001b[1m\u001b[38;5;231mHello World\u001b[0m\u001b[22m'
  </code></pre>
  
  <p>When I do: </p>
  
  <pre><code>console.log('\u001b[1m\u001b[38;5;231mHello World\u001b[0m\u001b[22m')
  </code></pre>
  
  <p>a <code>"Hello World"</code> white and bold message will be output.</p>
  
  <p>Having a string like <code>'\u001b[1m\u001b[38;5;231mHello World\u001b[0m\u001b[22m'</code> how can these elements be removed?</p>
  
  <pre><code>foo('\u001b[1m\u001b[38;5;231mHello World\u001b[0m\u001b[22m') //=&gt; "Hello World"
  </code></pre>
  
  <p>Maybe a good regular expression? Or is there any built-in feature?</p>
  
  <hr>
  
  <p>The work around I was thinking was to create  child process:</p>
  
  <pre><code>require("child_process")
   .exec("node -pe \"console.error('\u001b[1m\u001b[38;5;231mHello World\u001b[0m\u001b[22m')\""
   , function (err, stderr, stdout) { console.log(stdout);
   });
  </code></pre>
  
  <p>But the output is the same...</p>