
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
folder-tree-generator
Advanced tools
├── folder-tree-generator
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .prettierrc.json
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── example
│ │ │ └── index.ts
│ │ ├── folder1
│ │ │ ├── folder2
│ │ │ ├── folder3
│ │ │ │ └── folder4
│ │ ├── index.ts
│ │ ├── bin
│ │ │ └── index.ts
│ │ ├── utils
│ │ │ ├── drawTreeFromJsonDir.ts
│ │ │ ├── ftg.ts
│ │ │ ├── index.ts
│ │ │ ├── parseDirToJson.ts
│ │ │ └── sortFolder.ts
│ └── tsconfig.json
npm i folder-tree-generator -g
$ ftg [options]
Help options
$ ftg --help
Usage: dist [options]
Options:
-V, --version output the version number
-d, --directory [dir] Directory path. (default: "[current path]")
-f, --folder-only Draw folders only.
-s, --sort Sort alphabetically and put folders first and then files.
-c, --comments Show "Empty folder" comment (--folder-only must be false)
-e, --export [path] Set the folder path to export "ftg_tree_[date].txt" or just -e or --export for the default export to the current path
-i, --ignore [regex] Regex list to ignore folders and/or files (separated by commas) - eg: "example($|/.*),index.ts"
--emojis Show emojis - folder: 📁 - File: 📄
-h, --help display help for command
npx folder-tree-generator [options]
npm i folder-tree-generator
import { ftg, FtgOptions } from 'folder-tree-generator'
// get current path
const path = process.cwd()
// ftg options
const options: FtgOptions = { sort: true, emojis: true }
console.log('👇👇 Tree with options:', options)
const tree = ftg(path, options)
console.log(tree)
// OUTPUT
👇👇 Tree with options: { sort: true, emojis: true }
├── 📁 folder-tree-generator
│ ├── 📁 src
│ │ ├── 📁 example
│ │ │ └── 📄 index.ts
│ │ ├── 📁 bin
│ │ │ └── 📄 index.ts
│ │ ├── 📁 utils
│ │ │ ├── 📄 drawTreeFromJsonDir.ts
│ │ │ ├── 📄 ftg.ts
│ │ │ ├── 📄 index.ts
│ │ │ ├── 📄 parseDirToJson.ts
│ │ │ └── 📄 sortFolder.ts
│ │ └── 📄 index.ts
│ ├── 📄 .editorconfig
│ ├── 📄 .gitignore
│ ├── 📄 .prettierrc.json
│ ├── 📄 README.md
│ ├── 📄 package-lock.json
│ ├── 📄 package.json
│ └── 📄 tsconfig.json
| Terminal | Code | Type | Default | Description |
|---|---|---|---|---|
| -d -directory [dir] | Path is a parameter | string | Terminal: currentFolder - Code: path is required param | Folder Path |
| -f, --folders-only | folderOnly | boolean | false | generate tree only with folders (ignore files) |
| -s, --sort | sort | boolean | false | Sort alphabetically and put folders first and then files. |
| -c, --comments | comments | boolean | false | Show "Empty folder" comment (--folder-only must be false) |
| -e, --export [path] | [Not Available] | string | false | Set the folder path to export "ftg_tree_[date].txt" or just -e or --export for the default export to the current path |
| -i, --ignore [regex] | ignore | string | false | Regex list to ignore folders and/or files (separated by commas) - eg: "example($|/.*),index.ts" |
| --emojis | emojis | boolean | false | Show emojis - folder: 📁 - File: 📄 |
By default ftg ignore the following files and folders
Example
Ignore all index.ts files and folders named "/example"
ftg -i 'example($|/.*),index.ts'
Output
├── folder-tree-generator
│ ├── .editorconfig
│ ├── .prettierrc.json
│ ├── .versionrc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── bin
│ │ ├── utils
│ │ │ ├── drawTreeFromJsonDir.ts
│ │ │ ├── ftg.ts
│ │ │ ├── parseDirToJson.ts
│ │ │ └── sortFolder.ts
│ └── tsconfig.json
If files and folders are included and the comments option is also added, empty folders will show the comment "# Empty folder"
├── folder-tree-generator
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .prettierrc.json
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── example
│ │ │ └── index.ts
│ │ ├── folder1
│ │ │ ├── folder2 # Empty folder
│ │ │ ├── folder3
│ │ │ │ └── folder4 # Empty folder
│ │ ├── index.ts
│ │ ├── bin
│ │ │ └── index.ts
│ │ ├── utils
│ │ │ ├── drawTreeFromJsonDir.ts
│ │ │ ├── ftg.ts
│ │ │ ├── index.ts
│ │ │ ├── parseDirToJson.ts
│ │ │ └── sortFolder.ts
│ └── tsconfig.json
FAQs
Generate a folder tree structure using command line or code.
The npm package folder-tree-generator receives a total of 8 weekly downloads. As such, folder-tree-generator popularity was classified as not popular.
We found that folder-tree-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.