title: How to copy a file?
body: <p>How to copy a file in Node.js? </p>
  
  <p>Example</p>
  
  <pre><code>+ /old
  |- image.png
  + /new
  </code></pre>
  
  <p>I want to copy image1.png from 'old' to 'new' directory.</p>
  
  <p>This doesn't work.</p>
  
  <pre><code>newFile = fs.createWriteStream('./new/image2.png');     
  oldFile = fs.createReadStream('./old/image1.png');
  
  oldFile.addListener("data", function(chunk) {
    newFile.write(chunk);
  })
  
  oldFile.addListener("close",function() {
    newFile.end();
  });
  </code></pre>
  
  <p>Thanks for reply!</p>