title: nodejs how to read keystrokes from stdin
body: <p>Is it possible to listen for incoming keystrokes in a running nodejs script?
  If I use <code>process.openStdin()</code> and listen to its <code>'data'</code> event then the input is buffered until the next newline, like so:</p>
  
  <pre><code>// stdin_test.js
  var stdin = process.openStdin();
  stdin.on('data', function(chunk) { console.log("Got chunk: " + chunk); });
  </code></pre>
  
  <p>Running this, I get:</p>
  
  <pre><code>$ node stdin_test.js
                  &lt;-- type '1'
                  &lt;-- type '2'
                  &lt;-- hit enter
  Got chunk: 12
  </code></pre>
  
  <p>What I'd like is to see:</p>
  
  <pre><code>$ node stdin_test.js
                  &lt;-- type '1' (without hitting enter yet)
   Got chunk: 1
  </code></pre>
  
  <p>I'm looking for a nodejs equivalent to, e.g., <a href="http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_io.html#IO.getc" rel="noreferrer"><code>getc</code> in ruby</a></p>
  
  <p>Is this possible?</p>