JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q67420F
  • License ISC

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.json

Install

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

$ ftg

Or 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 command

Code

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