title: How to fetch package version and date in npm script?
body: <p>I have a package.json file and I have this script to create 2 separate files one for version and other one for date. </p>
  
  <p>When i run the command, it generates the <code>version-npm.txt</code> with correct data holding the current version, but the version.txt file is generated with the exact script instead, it contains <code>date +"%d/%m/%Y %T"</code></p>
  
  <pre><code>"scripts": {
      "versions": "node -e \"console.log(require('./package.json').version);\" &gt; ./public/version-npm.txt &amp;&amp; echo `date +\"%d/%m/%Y %T\"` &gt; ./public/version.txt" 
  }
  </code></pre>
  
  <p>I need this to be updated with the current date and time. is there any other way to it or can you help me fix it?</p>
  
  <p>i tried writing the date as <code>\"$(date)\"</code> still the same, now i get <code>\"$(date)\"</code></p>