title: event listener for phantomjs stdin
body: <p>Is it possible to set up an event listen for phantomjs's <code>system.stdin</code> events?</p>
  
  <p>example where phantomjs can read from stdin but halts everything while waiting for input:</p>
  
  <pre><code>var system = require('system');
  
  system.stdout.writeLine('waiting for user input...');
  var input = system.stdin.readLine();
  // anything down here won't execute until input has been received
  </code></pre>
  
  <p>The ideal solution would be like nodejs's <a href="http://nodejs.org/api/process.html#process_process_stdin" rel="nofollow"><code>process.stdin.on()</code></a></p>
  
  <p>phantomjs does not seem to give any methods to do this but it must still be possible.</p>
  
  <p>I was thinking I could use <a href="http://phantomjs.org/api/fs/method/open.html" rel="nofollow"><code>fs.open()</code></a> and poll the stream for changes but I can't figure out how to open the right file for stdio/tty or if that's even relevant to what I'm trying to do.</p>
  
  <p>I'm using phantomjs version 1.9.0 on Debian 6</p>