title: Javascript - Move file to another directory (node.js)
body: <p>I want to copy a file and change the directory of that file </p>
  
  <p>Here is my file location:</p>
  
  <pre><code>Test.zip -&gt; Account/Images/
                     -account.png
                     -icon.png
                     -flag.png
                      .
                      .
  </code></pre>
  
  <p>When I use the script for extracting the files I want to have, just account.png file outside of Images folder  :</p>
  
  <pre><code>Account/
       - account.png
       - Images/ icon.png,flag.png
  </code></pre>
  
  <p>Here is my function</p>
  
  <pre><code>function processFiles(fileDir, outputDir, accountData) {
  
  var fileDensities;
  fileDensities.forEach(function(density) {
      var srcPath = path.join(fileDir, 'Account', output);
      if (!fs.existsSync(srcPath)) {
          console.log('Warning: image does not exist' + output);
          return;
      };
      var outputPath = path.join(outputDir, output);
      mkdirp.sync(outputPath);
      var srcFilenames = fs.readdirSync(srcPath);
      srcFilenames.forEach(function(filename) {
  
    });
   }
  </code></pre>
  
  <p>Right-now the output is :</p>
  
  <pre><code>    Account/Images/account.png,icon.png,flag.png
  </code></pre>
  
  <p>My question is how can I add account.png outside of Images folder</p>
  
  <pre><code>Account/
       - account.png
       - Images/ icon.png,flag.png
  </code></pre>
  
  <p>Thanks in Advance!</p>