Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>My Directory List & Print ExtensionNew to Visual Studio Code? Get it now.
My Directory List & Print Extension

My Directory List & Print Extension

Daryoush Alipour tirotir

|
38 installs
| (0) | Free
A handy extension for listing, exporting, and creating directory structures from text or ASCII trees.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

My Directory List & Print Extension

A handy extension for listing, exporting, and creating directory structures from text or ASCII trees.

This extension provides:

  1. Directory listing (multi-directory, optional sorting).
  2. Exports to CSV or JSON.
  3. Creates directory/file structures from:
    • Line-based text files.
    • ASCII tree diagrams.
  4. Generate an ASCII tree for any directory (like the tree command).

Commands

  • Directory List: List Directories (Text)
    Command ID: directoryListPrint.listDirectory
    Lists directories in plain text.

  • Directory List: Export as CSV
    Command ID: directoryListPrint.exportCSV

  • Directory List: Export as JSON
    Command ID: directoryListPrint.exportJSON

  • Directory List: Create Structure (ASCII Tree)
    Command ID: directoryListPrint.createStructureFromAscii
    Parses an ASCII tree file and creates the folders/files under a chosen root.

  • Directory List: Create Structure (Line-Based)
    Command ID: directoryListPrint.createStructureLineBased
    Reads a text file with lines ending in / as folders and the rest as files.

  • Directory List: Generate ASCII Tree
    Command ID: directoryListPrint.generateAsciiTree
    Recursively traverses a folder, displaying it as an ASCII tree.

Usage

  1. Install dependencies: npm install
  2. Compile: npm run compile
  3. Open in VS Code, press F5 to launch an Extension Development Host.
  4. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and look for commands under Directory List: ....

ASCII Tree Notes

  • The extension uses a simple indentation-based parser (4 spaces per indent).
  • If your tree uses different spacing, adjust the code to match your style.
  • If your lines do not show full subdirectories, you’ll get partial paths. For deeper structure, consider providing the full path or use the advanced parser with consistent indentation.

Example 1: Create Structure from a Line-Based File

src/
src/index.js
assets/
assets/logo.png
docs/readme.md

or:

my-website/
my-website/index.html
my-website/styles/
my-website/styles/styles.css
my-website/scripts/
my-website/scripts/app.js
my-website/assets/
my-website/assets/logo.png
my-website/assets/banner.jpg
my-website/README.md
  • Lines ending with / are treated as folders.
  • All other lines are treated as files.

Example 2: Create Structure from an ASCII Tree

my-website/
├── index.html
├── styles/
│   └── styles.css
├── scripts/
│   └── app.js
├── assets/
│   ├── logo.png
│   └── banner.jpg
└── README.md

Example 3: Create a Large Structure from an ASCII Tree

my-large-project/
├── .vscode/
│   ├── settings.json
│   └── launch.json
├── .github/
│   └── workflows/
│       └── ci.yml
├── config/
│   ├── default.json
│   ├── development.json
│   └── production.json
├── docs/
│   ├── getting_started.md
│   ├── architecture.md
│   └── api_reference.md
├── src/
│   ├── app/
│   │   ├── controllers/
│   │   │   ├── userController.js
│   │   │   └── orderController.js
│   │   ├── models/
│   │   │   ├── userModel.js
│   │   │   └── orderModel.js
│   │   ├── services/
│   │   │   ├── authService.js
│   │   │   └── paymentService.js
│   │   └── routes/
│   │       ├── userRoutes.js
│   │       └── orderRoutes.js
│   ├── config/
│   │   └── config.js
│   ├── index.js
│   └── server.js
├── public/
│   ├── css/
│   │   └── styles.css
│   ├── js/
│   │   └── main.js
│   └── index.html
├── tests/
│   ├── unit/
│   │   └── app.test.js
│   └── integration/
│       └── api.test.js
├── scripts/
│   ├── build.sh
│   └── deploy.sh
├── .env
├── .gitignore
├── package.json
├── README.md
└── LICENSE
  • The extension strips ├, ─, └, │ to derive basic line-based paths.
  • For nested folders, consider providing full paths or using an advanced parser.

Limitations

  • ASCII Tree Indentation: The extension’s ASCII tree parser relies on a consistent number of spaces (e.g., 2, 3, or 4) per indentation level. If the diagram uses tabs or inconsistent spacing, the generated directory structure may be incorrect.
  • No Full Paths: By default, ASCII trees don’t list the full path on each line. The extension infers nesting by indentation. If you need a highly reliable approach, consider providing explicit full paths or a line-based file.
  • Very Large Projects: Extremely large or deeply nested ASCII diagrams can lead to performance issues or truncated paths. Consider breaking them into smaller segments if you encounter slowdowns.

License

Licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Thank you for using the My Directory List & Print Extension. We hope it simplifies your workflow!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft