title: Readline output to file Node.js
body: <p>How can I write output to file? I tried instead of <code>process.stdout</code> use <code>fs.createWriteStream(temp + '/export2.json')</code>, but it's not working.</p>
  
  <pre><code>var rl = readline.createInterface({
      input: fs.createReadStream(temp + '/export.json'),
      output: process.stdout,
      terminal: false
  });
  
  rl.on('line', function(line) {
      rl.write(line);
  });
  </code></pre>