🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
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

Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

tree-directory

Print a directory structure in the tree format

Usage

var tree = require('tree-directory')

var res = tree.sync(__dirname + '/fixtures')

console.log(res.obj)
console.log(res.basedir)
console.log(res.str)

output:

⌘ node example/tree.js
{ a: { b: { c: null }, d: null }, e: { f: null }, g: null }
/Users/zoubin/usr/src/zoubin/tree-directory/example/fixtures
├─ a
│  ├─ b
│  │  └─ c
│  └─ d
├─ e
│  └─ f
└─ g

rv = tree(basedir, patterns)

Return a promise that resolves to the tree info object of basedir.

basedir

Type: String

The target directory

patterns

Type: String, Array

Default: **/*

See globby

rv

  • obj: object representation
  • str: string representation
  • basedir: the basedir itself

Keywords

tree

FAQs

Package last updated on 08 Oct 2015

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