title: Read all JSON files contained in a dynamically updated folder
body: <p>I've got multiple json files contained within a directory that will dynamically be updated by users. The users can add categories which will create new json files in that directory, and they can also remove categories which would delete json files in that directory. I'm looking for a method to read all json files contained in that folder directory, and push all the json files into a single object array. I imagine asynchronously would be desirable too.</p>
  
  <p>I'm very new to using fs. I've management to read single json files by directory using</p>
  
  <pre><code>const fs = require('fs');
  
  let data = fs.readFileSync('./sw_lbi/categories/category1.json');
  let categories = JSON.parse(data);
  console.log(categories);
  </code></pre>
  
  <p>But of course this will only solve the synchronous issue when using <code>require()</code></p>
  
  <p>As I'll have no idea what json files will be contained in the directory because the users will also name them, I'll need a way to read all the json files by simply calling the folder directory which contains them. </p>
  
  <p>I'm imagining something like this (which obviously is foolish)</p>
  
  <pre><code>const fs = require('fs');
  
  let data = fs.readFileSync('./sw_lbi/categories');
  let categories = JSON.parse(data);
  console.log(categories);
  </code></pre>
  
  <p>What would be the best approach to achieve this?</p>
  
  <p>Thanks in advance.</p>