title: Weird behaviour with Node.js exec and stdout
body: <p>I'm trying to convert String to Boolean from stdout.</p>
  
  <p>Someone could explain me why this code return <code>false</code> instead <code>true</code>:</p>
  
  <pre><code>const { exec } = require('child_process')
  
  exec('echo true', {}, (err, stdout) =&gt; {
      const current = stdout.toString();
  
      console.log(typeof current, current) // &lt;- It returns: string true
  
      const status = (current === 'true');
  
      console.log(status); // &lt;- I echoed true, I checked for true and instead I'm getting false
  })
  </code></pre>
  
  <p><a href="https://repl.it/@michelem09/WeirdStdout" rel="nofollow noreferrer">https://repl.it/@michelem09/WeirdStdout</a></p>