title: Move files with node.js
body: <p>Let's say I have a file "<em>/tmp/sample.txt</em>" and I want to move it to "<em>/var/www/mysite/sample.txt</em>" which is in a different volume.</p>
  
  <p>How can i move the file in node.js?</p>
  
  <p>I read that <em>fs.rename</em> only works inside the same volume and <em>util.pump</em> is already deprecated.</p>
  
  <p>What is the proper way to do it? I read about stream.pipe, but I couldn't get it to work. A simple sample code would be very helpful.</p>