title: how to add new line using fs.writeFile?
body: <p>I tried to write my project's files to a new file, each one in <strong>new line</strong>, using Node.js. How can I do that? Below is my code:</p>
  
  <pre><code>var fs = require('fs');
  var colors = require('colors');
  
  fs.readdir('./', 'utf-8', function(err, data) {
      if (err) throw err;
      console.log(data);
      fs.writeFile('./new.txt', data, function(err) {
        if (err) throw err;
        console.log('Saved!'.blue);
      }); 
    });
  </code></pre>