Package Exports
- folder-tree-generator
- folder-tree-generator/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (folder-tree-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
FTG - Folder tree generator
Generate a folder tree as a string from a path using terminal or by importing in your ts/js file.
├── folder-tree-generator
│ ├── src
│ │ ├── utils
│ │ │ ├── drawTreeFromJsonDir.ts
│ │ │ ├── index.ts
│ │ │ ├── parseDirToJson.ts
│ │ │ └── sortFolder.ts
│ │ └── index.ts
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .prettierrc.json
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.jsonInstall
Terminal.
npm i folder-tree-generator -g
TS/JS
npm i folder-tree-generator
Usage
Terminal
No flags to generate tree of the current path
$ ftgOr adding flags
$ ftg [options]Help options
$ ftg --help
Options:
-V, --version output the version number
-d, --directory [dir] Directory path. (default: "[current path]")
-f, --folder-only Draw folders only.
-h, --help display help for commandCode
import { ftg } from 'folder-tree-generator'
// get current path
const path = process.cwd()
const tree = ftg(path)
console.log(tree)Defaults
By default ftg ignore the following files and folders
- .vscode
- .DS_Store
- .git
- node_modules
- dist
TODO
- Add command flags
- --folder-only
- --ignore (regex)
- --export
- Interactive terminal
- add ftg() options
- folderOnly
- ignoreRegex
- ignoreArray