title: How to get an array based list of directories in node.js
body: <p>Let's say we have a directory that contains four folders, like so:</p>
  
  <pre><code>- folder-1
  - folder-2
  - folder-3
  - folder-4
  </code></pre>
  
  <p>How can I get their path and store them in an array so I'd have an array like:</p>
  
  <pre><code>['root/parent/folder-1', 'root/parent/folder-2', 'root/parent/folder-3', 'root/parent/folder-4']
  </code></pre>