title: How to prompt execution`s status of a shell command in javascript?
body: <p>I'm looking for a way to print in a webpage the status of the execution of a shell command.
  Using NodeJS and a module called sudo-js I execute a command that in shell prints the status of the execution, the problem is that I just print all the progress at the end of the execution in the website, but I would like to print that in real time as in shell terminal into the webpage.</p>
  
  <p>Here is my code</p>
  
  <pre><code>          if (err) {
              console.log(err.stack); 
            } else {
              var command = ['ansible-playbook', '-i', 'hosts.txt', 'sample.yaml'];
              sudo.exec(command, function(err, pid, result) {
              console.log(result);
              res.render('mensajeScriptEjecutadoConResultado', {Resultado: result});
              });
  
            }
          })
  </code></pre>
  
  <p>I know that console.log() doesn't work in showing data by buffer or in real time, and sudo.exe() may not work like this too, so how to do that?.</p>
  
  <p>Thank you!.</p>