title: fs.writeFile() only saving part of string
body: <p>I'm creating a text editor using node-webkit. When the user clicks a "Save" menu item, I get write a plain text file to disk using the fs.writeFile() method:</p>
  
  <pre><code>fs.writeFile(file, txt, function (err) {
    if (err) throw err;
    console.log("file saved");
  });
  </code></pre>
  
  <p>However, it's not saving the entire string passed through the "txt" variable. It's only saving the first 300 characters or so to the file.</p>
  
  <p>I've tried using this method, and the synchronous method fs.writeFileSync. Both are having the same problem. I've tried logging the txt string passed to the method to make sure there's nothing wrong there.</p>
  
  <p>Any ideas why I'm not getting the full text in my saved file?</p>