/dir.tree.js

Get tree object with a directory. :zzz:

Primary LanguageJavaScript

dir.tree

Build Status NPM Version

Get tree object with a directory, example:

{ path: '/Users/solome/dir.tree.js/src',
  sub:
    [
      { path: '/Users/solome/dir.tree.js/src/app.js',
        sub: [] },
      { path: '/Users/solome/dir.tree.js/src/debug.js',
        sub: [] }
    ]
}

Installation

npm install -g dir.tree.js

Usage

Node

import DirTree from 'dir.tree.js'

const path = __dirname

const dirTree = DirTree(path)

Commander: list contents of directories in a tree-like format.

$ dt -s

Output demo:

.
├── dir
|   └── subdir
|       └── empty.file
└── dirtree.js

License

MIT