title: node.js and ncp module - fails to copy single file
body: <p>I am using <a href="https://nodejs.org/dist/latest-v6.x/docs/api/" rel="nofollow noreferrer">Node.js v6.3.1</a> and <a href="https://www.npmjs.com/package/ncp" rel="nofollow noreferrer">ncp v2.0.0</a></p>
  
  <p>I can only get ncp to copy the contents of a directory, but not a single file within that directory.</p>
  
  <p>Here is the code copying the contents of a directory recursively that works:</p>
  
  <pre><code>var ncp = require("ncp").ncp;
  ncp("source/directory/", "destination/directory/", callback);
  </code></pre>
  
  <p>...and here is the same code but with a file as the source:</p>
  
  <pre><code>var ncp = require("ncp").ncp;
  ncp("source/directory/file.txt", "destination/directory/", callback);
  </code></pre>
  
  <p>From this all I can think is that ncp was specifically designed to copy directories recursively, not single files maybe?</p>
  
  <p>I had thought about using something like fileSystem's <a href="https://nodejs.org/dist/latest-v6.x/docs/api/fs.html#fs_class_fs_readstream" rel="nofollow noreferrer">read</a>/<a href="https://nodejs.org/dist/latest-v6.x/docs/api/fs.html#fs_class_fs_writestream" rel="nofollow noreferrer">write</a> stream functions as described <a href="https://stackoverflow.com/a/11295106/532489">here</a> but really for consistency I was hoping to stick with ncp.</p>
  
  <p>Update:</p>
  
  <p>I have found another package called <a href="https://www.npmjs.com/package/node-fs-extra" rel="nofollow noreferrer">node-fs-extra</a> which does what I want without the need for me to add event handlers to the operations, like I would have to do with the fileSystem read/write solution.</p>
  
  <p>Here is the code that is working:</p>
  
  <pre><code>var fsExtra = require("fs-extra");
  fsExtra.copy("source/directory/file.txt", "destination/directory/file.txt", callback);
  </code></pre>
  
  <p>Obviously this still is inconsistent, but at least is a little less verbose.</p>