- Install the Linux package tree using Homebrew:
brew install tree
- Run the tree command on any directory to generate a Markdown friendly structure:
tree your-directory
You can save it to a file by piping the results into a text file:
tree . >> directory-structure.md
packages/button
├── lib
│ ├── button.d.ts
│ ├── button.js
│ ├── button.js.map
│ ├── button.stories.d.ts
│ ├── button.stories.js
│ ├── button.stories.js.map
│ ├── index.d.ts
│ ├── index.js
│ └── index.js.map
├── package.json
├── src
│ ├── button.stories.tsx
│ ├── button.tsx
│ └── index.ts
└── tsconfig.json