title: node.js child_process password input for git clone in atom
body: <p>I am trying to clone a git repository requiring the child_process module of node.js in my atom package:</p>
  
  <pre><code>    var spawn = require('child_process').spawn;
      var gitClone = spawn('git', ['clone', 'ssh://user@gitrepo.com/path/to/reponame'], {cwd: path});
  
      gitClone.stdout.on('data', (data) =&gt; {
          gitClone.stdin.write('password');
          console.log(`stdout: ${data}`);
      });
  
      gitClone.stderr.on('data', (data) =&gt; {
          console.log(`stderr: ${data}`);
  
      });
  
      gitClone.on('close', (code) =&gt; {
          console.log(`child process exited with code ${code}`);
      });
  </code></pre>
  
  <p>As it is not possible to use a ssh key, I need to pass the user's password to the spawned process.</p>
  
  <p>I thought regarding <a href="https://stackoverflow.com/questions/13655713/write-to-spawned-process-stdin-nodejs">this topic</a> would solve my problem as well, but it seems like there is not a possibility to get into my <code>gitClone.stdout.on('data', function (data) { ... }</code>.
  Any <code>console.log()</code> I am trying to perform from in there, will not be displayed on the chrome engine's console.</p>
  
  <p>Here is my output:</p>
  
  <pre><code>    stderr: Cloning into 'reponame'...
      stderr: Permission denied, please try again.
      stderr: Permission denied, please try again.
      stderr: Permission denied (publickey,password).
      stderr: fatal: Could not read from remote repository.
      Please make sure you have the correct access rights and the repository exists.
      child process exited with code 128
  </code></pre>
  
  <p>I am wondering why I can see only the sdterr-messages. When I run <code>git clone</code> in my bash it first tells me <code>Cloning into 'reponame'...</code>, then it asks for my password.</p>
  
  <p>Is there a way to catch the password prompt in child_process' <code>spawn()</code>?</p>