tree-from-paths
Convert a list of paths into a archy directory-tree
Installation
npm install tree-from-paths
Usage
The following example demonstrates how to use this module:
var render = console const files = path: 'basedir/dir1/file1.txt' created: true path: 'basedir/dir1/file2.txt' path: 'basedir/dir2/file3.txt' path: 'basedir/dir3/' path: 'basedir/dir3/file4.txt' created: true path: 'basedir/dir3/file5.txt' path: 'basedir/dir4/dir5/file7.txt' console
This will generate the following output
<a href='basedir/'>/</a>
├─┬ <a href='basedir/dir1/'>dir1/</a>
│ ├── <a href='basedir/dir1/file1.txt'>file1.txt(*)</a>
│ └── <a href='basedir/dir1/file2.txt'>file2.txt(*)</a>
├─┬ <a href='basedir/dir2/'>dir2/</a>
│ └── <a href='basedir/dir2/file3.txt'>file3.txt(*)</a>
├─┬ <a href='basedir/dir3/'>dir3/(*)</a>
│ ├── <a href='basedir/dir3/file4.txt'>file4.txt(*)</a>
│ └── <a href='basedir/dir3/file5.txt'>file5.txt(*)</a>
└─┬ <a href='basedir/dir4/'>dir4/</a><a href='basedir/dir4/dir5/'>dir5/</a>
└── <a href='basedir/dir4/dir5/file7.txt'>file7.txt(*)</a>
<a href='basedir/'>/</a>
├─┬ <a href='basedir/dir1/'>dir1/</a>
│ ├── <a href='basedir/dir1/file1.txt'>file1.txt created</a>
│ └── <a href='basedir/dir1/file2.txt'>file2.txt</a>
├─┬ <a href='basedir/dir2/'>dir2/</a>
│ └── <a href='basedir/dir2/file3.txt'>file3.txt</a>
├─┬ <a href='basedir/dir3/'>dir3/</a>
│ ├── <a href='basedir/dir3/file4.txt'>file4.txt created</a>
│ └── <a href='basedir/dir3/file5.txt'>file5.txt</a>
└─┬ <a href='basedir/dir4/'>dir4/</a><a href='basedir/dir4/dir5/'>dir5/</a>
└── <a href='basedir/dir4/dir5/file7.txt'>file7.txt</a>
License
tree-from-paths
is published under the MIT-license.
See LICENSE.md for details.
Release-Notes
For release notes, see CHANGELOG.md
Contributing guidelines
See CONTRIBUTING.md.