title: How to respond to a command line promt with node.js
body: <p>How would I respond to a command line prompt programmatically with node.js? For example, if I do <code>process.stdin.write('sudo ls');</code> The command line will prompt for a password. Is there an event for 'prompt?'</p>
  
  <p>Also, how do I know when something like <code>process.stdin.write('npm install')</code> is complete?</p>
  
  <p>I'd like to use this to make file edits (needed to stage my app), deploy to my server, and reverse those file edits (needed for eventually deploying to production). </p>
  
  <p>Any help would rock!</p>