title: node js: does fs.rename overwrite file if already exists
body: <p>Does fs.rename overwrite the file if it already exists?</p>
  
  <pre><code>var fs = require('fs'),
      oldPath = 'firstfile.txt',
      newPath = 'temp/firstfile.txt';
  
  fs.rename(oldPath, newPath, function (err) {
      console.log('rename callback ', err); 
  });
  </code></pre>
  
  <p>What happens if '/newFolder/somefile.txt' aready exists ? </p>