title: Node.js Spawn Display STDOUT live not working
body: <p>I have an app it receives file links and downloads them, for downloading I am used aria2c.</p>
  
  <p>For doing this first I used <code>exec</code>, but since I want to get download progress then I used <code>spawn</code></p>
  
  <p>Here is code i am using for download file with aria2c:</p>
  
  <pre><code>'use strict';
  
  const
      spawn = require( 'child_process' ).spawn,
      aria2c = spawn( 'aria2c', ['-x8', 'https://wa-us-ping.vultr.com/vultr.com.100MB.bin' ] );
  
  aria2c.stdout.on( 'data', data =&gt; {
      console.log( `stdout: ${data}` );
  });
  
  aria2c.stderr.on( 'data', data =&gt; {
      console.log( `stderr: ${data}` );
  });
  
  aria2c.on( 'close', code =&gt; {
      console.log( `child process exited with code ${code}` );
  });
  </code></pre>
  
  <p>When I run this code it doesn't print aria2c output to stdout, it only shows it when download finished.</p>
  
  <p>I want to know how I can fix this.</p>