How to get the project folder tree?


#1

Is there a way (a package) to get a folder tree in Atom? Like this:
| .gitignore
| favicon.ico
| index.php
|
±–views
| layout.php
| css.css
| js.js
|
±–model
| | request.php
| |
| ±–database
| | | add.php
| | | change.php
| | |
| | —queries
| | users.php
| | data.php
| |
Before now, I have used PowerShell with the command:
tree /F > tree.txt


#2

Sorry, the tree should have been like this:

|   .gitignore
|   favicon.ico
|   index.php
|   
+---views
|       layout.php
|       css.css
|       js.js
|       
+---model
|   |   request.php
|   |   
|   +---database
|   |   |   add.php
|   |   |   change.php
|   |   |   
|   |   \---queries
|   |           users.php
|   |           data.php
|   |

#3

If you have basic knowledge of JavaScript, it’s fairly simple to write package that does just that, even as a beginner.

It’s basically three step:

  1. Use atom.project.getPaths() to get the project path(s)

  2. Get the file-contents with fs.readdir()

  3. Write an ASCII file tree with a library such as tre