🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

tree-directory

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-directory

Print a directory structure in the tree format

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

tree

FAQs

Package last updated on 11 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts