title: Unknown method process.openStdin()
body: <p>I'm trying to pipe grep results into nodejs script. I've found, that I should receive data from process.stdin.</p>
  
  <p>Also I've found several ways to work with stdin. But they are different and I can't find all information about it. I know four ways (first 3 start with <code>var data = ""</code>):</p>
  
  <p>1) Most popular in search results</p>
  
  <pre><code>process.stdin.resume();
  process.stdin.setEncoding( 'utf8' );
  process.stdin.on('data', function(chunk) { data += chunk; });
  process.stdin.on('end', function() { console.log('data: ' + data); });
  </code></pre>
  
  <p>2) Looks like the first one, but with unknown function <code>process.openStdin()</code></p>
  
  <pre><code>var stdin = process.openStdin();
  stdin.on('data', function(chunk) { data += chunk; });
  stdin.on('end', function() { console.log('data: ' + data); });
  </code></pre>
  
  <p>3) In the documentation I've read that calling <code>stdin.resume()</code> changes stdin to 'old type'. So if we didn't called 'resume' - we can use 'readable' event</p>
  
  <pre><code>process.stdin.setEncoding('utf8');
  process.stdin.on('readable', function() { data += process.stdin.read(); });
  process.stdin.on('end', function() { console.log('data: ' + data); });
  </code></pre>
  
  <p>4) Use module readline. It is very usefull as long as grep results are in mutiple lines and there I don't need to split received data by myself. But for a long time i couldn't understand why all information is piped to stdout directly. Then i i've found that we can pass empty object instead of process.stdout while creating interface and data wouldn't piped to output.</p>
  
  <pre><code>var readline = require('readline'),
  //rl = readline.createInterface(process.stdin, process.stdout);
  rl = readline.createInterface(process.stdin, {});
  rl.on('line', function(data) { console.log('line: ' + data); });
  </code></pre>
  
  <p>5) My own variant. Use another module 'split' - it allows to read from stream and devide data into chuks by specified symbol (<code>\r?\n</code> by default). I used it to work with socket and as soon as stdin is also readable stream - we can use it here.</p>
  
  <pre><code>var split = require('split');
  process.stdin.setEncoding('utf8');
  process.stdin.pipe(split()).on('data', function(data) { console.log('line: ' + data); });
  </code></pre>
  
  <p>My question is <strong>"What is <code>process.openStdin();</code>????"</strong></p>
  
  <p>I've searched every page in google, but didn't found any documentation on this function! </p>
  
  <p>Also while searching I've discovered, that official documentation for nodejs is ugly - not mentioned since which version methods are available, no detailed description on many objects/methods, no user comments. And this method (<code>openStdin</code>) - exists and works, but nowhere discribed! WTF???</p>