title: return an array from glob node js
body: <p><strong>The issue</strong> </p>
  
  <p>I'm using the answer here <a href="https://stackoverflow.com/questions/41462606/get-all-files-recursively-in-directories-nodejs/41462807#41462807">Get all files recursively in directories NodejS</a>
  however, when I assign it to a constant I'm trying to return the directories so I can have them available in an array, I have looked through globs documentation for an asnwer <a href="https://github.com/isaacs/node-glob" rel="nofollow noreferrer">https://github.com/isaacs/node-glob</a>, however I have had no successful results, I have tried using glob.end() and I have also console.log the <strong>folds</strong> variable below, I can see all the list of available methods and I have tried to use some of them with no success, does anyone know how to return the array like in the code example below? Thank you!</p>
  
  <pre><code> const glob = require('glob');
   const src = 'assets';
  
  
  function getFiles(err, res){
    if (err) {
     console.log('Error', err);
    } else {
    return res
    }
  }
  
  let folds =  glob(src + '/**/*', getFiles);
  </code></pre>