title: How to copy data from one directory to another using nodejs fs?
body: <p>trying to copy parent content to child its throwing error and going into catch , any idea what i am doing wrong here.</p>
  <p>main.js</p>
  <pre><code>const fs = require('fs-extra');
  const copyDirectories = function(data) {
  
          let destination = 'services/test2/tmp';
          let source = 'services/test2';
          fs.copy(source, destination)
          .then(() =&gt; console.log('Copy completed!'))
          .catch( err =&gt; {
              console.log('An error occured while copying the folder.')
              return console.error(err)
          })
       }
  </code></pre>