title: Get all files recursively in directories NodejS
body: <p>I have a little problem with my function. I would like to get all files in many directories. Currently, I can retrieve the files in the file passed in parameters. I would like to retrieve the html files of each folder in the folder passed as a parameter. I will explain if I put in parameter "test" I retrieve the files in "test" but I would like to retrieve "test / 1 / *. Html", "test / 2 / <em>. /</em>.html ":   </p>
  
  <pre><code>var srcpath2 = path.join('.', 'diapo', result);
  function getDirectories(srcpath2) {
                  return fs.readdirSync(srcpath2).filter(function (file) {
                      return fs.statSync(path.join(srcpath2, file)).isDirectory();
                  });
              }
  </code></pre>
  
  <p>The result :
  [1,2,3]</p>
  
  <p>thanks !</p>