1.1.3 • Published 1 year ago

@karmaniverous/dirtree v1.1.3

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
1 year ago

dirtree

Parses a directory into a nicely-formatted ASCII tree. Includes a CLI.

To install:

npm install @karmaniverous/dirtree

To import:

import { dirtree } from '@karmaniverous/dirtree`;

An Example

PS C:\> dirtree -d src -a size
└─ src
   ├─ cli
   │  └─ index.mjs: 1344
   └─ export
      ├─ dirtree
      │  ├─ dirtree.mjs: 2045
      │  └─ dirtree.test.mjs: 303
      └─ index.mjs: 73

Command Line Interface

Usage: dirtree [options]

Options:
  -a, --attribute <string>  Decorate files with an fs.Stats attribute. https://nodejs.dev/en/api/v19/fs/#fsstats
  -n, --depth <int>         Limit the tree to this depth. Default is unlimited.
  -d, --dir <string>        Path to starting directory. Defaults to current working directory.
  -e, --exclude <string>    RegExp pattern to exclude paths from tree.
  -h, --help                display help for command

API Documentation

dirtree(options) ⇒ string

Extracts an ascii tree representing the file structure under a directory path.

Kind: global function
Returns: string - ASCII tree.

ParamTypeDescription
optionsObjectOptions object.
options.attributestringDecorate files with an fs.Stats attribute. https://nodejs.dev/en/api/v19/fs/#fsstats
options.debugbooleanLog intermediate steps to console.
options.depthnumberLimit the tree to this depth. Default is unlimited.
options.dirstringPath to starting directory. Defaults to current working directory.
options.excludeRegExpRegExp pattern to exclude paths from tree.

See more great templates and other tools on my GitHub Profile!

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago