title: How to print file path with directory Indentation Nodejs
body: <p>Printing file path with directory indentation.
  Input will be</p>
  <pre><code>[
    &quot;/root/html/file/a.html&quot;,
    &quot;/root/html/image/a.jpg&quot;,
    &quot;/root/html/file/b.html&quot;,
    &quot;/tmp/c.log&quot;
  ]
  </code></pre>
  <p>Output needs to be like following,</p>
  <pre><code>- root
    - html 
       - file
         - a.html
         - b.html
       - image
         - a.jpg
  - tmp
    - c.log
  </code></pre>
  <p>I couldn't find any solution. I guess it will be a recursive call with a tree structure. Any help would be appreciated.</p>