tree-directory

0.1.0 • Public • Published

tree-directory

version status dependencies devDependencies

Print a directory structure in the tree format

Example

Directory structure

example/src
├── page
│   ├── hello
│   │   └── index.css
│   └── world
│       ├── index.css
│       └── index.js
└── vendor
    └── index.js

To print all javascript files:

var tree = require('tree-directory')
 
tree(__dirname + '/src', '**/*.js').then(function (res) {
  console.log(res)
})
 

Output

├─ page
│  └─ world
│     └─ index.js
└─ vendor
   └─ index.js

tree(root[, patterns])

Return a promise which resolves to a treeish string representing the directory root (not including itself).

root

The target directory to format.

Type: String

patterns

Globs to match the files to include.

Type: String, Array

Default: **/*

tree.sync(root[, patterns])

Just return the treeish string.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    3
  • 0.0.1
    0

Package Sidebar

Install

npm i tree-directory

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • zoubin