title: How to rename file with npm script
body: <p>I am using <a href="https://www.npmjs.com/package/copyfiles" rel="noreferrer">copyfiles</a> as an npm <code>scirpt</code> <code>copyfiles -u 2 /src/app/conf.dev.json dist/config/</code>  but in the end I want to get the file renamed </p>
  
  <p>How would you rename the input file in to something like <code>conf.json</code> ?</p>
  
  <p>I check the docs and didn't find that it is possible to achieve with <code>copyfiles</code>.
  Any thoughts?</p>
  
  <p><strong>UPDATE</strong>:
  I follow up to this <a href="https://stackoverflow.com/questions/35258871/rename-file-with-npm">Rename file with NPM</a> but getting an error when do <code>npm run copy</code>:</p>
  
  <pre><code>"copy": "copyfiles -u 2 /src/app/conf.dev.json dist/config/ &amp;&amp; node -e require('fs').rename('dist/config/conf.prod.json','dist/config/conf.json')"
  </code></pre>
  
  <blockquote>
    <p>fs.js:137
        throw new ERR_INVALID_CALLBACK();
        ^</p>
    
    <p>TypeError [ERR_INVALID_CALLBACK]: Callback must be a function</p>
  </blockquote>