All Projects β†’ yangshun β†’ Tree Node Cli

yangshun / Tree Node Cli

Licence: mit
🌲 Node.js library to list the contents of directories in a tree-like format, similar to the Linux tree command

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tree Node Cli

gtree
Output tree🌳 or Make directoriesπŸ“ from #Markdown or Programmatically. Provide CLI, Golang library and Web (using #Wasm ).
Stars: ✭ 88 (-13.73%)
Mutual labels:  tree, directory, file
directory-structure
πŸ“¦ Print a directory tree structure in your Python code.
Stars: ✭ 40 (-60.78%)
Mutual labels:  tree, directory, file
fsify
Convert an array of objects into a persistent or temporary directory structure.
Stars: ✭ 24 (-76.47%)
Mutual labels:  tree, directory, file
Cpx
A cli tool to watch and copy file globs.
Stars: ✭ 394 (+286.27%)
Mutual labels:  directory, cli, file
gitree
Print a directory tree that shows Git status and ignores files dictated by .gitignore.
Stars: ✭ 32 (-68.63%)
Mutual labels:  tree, directory
files
Useful methods to manage files and directories
Stars: ✭ 27 (-73.53%)
Mutual labels:  directory, file
Markserv
🏁 serve markdown as html (GitHub style), index directories, live-reload as you edit
Stars: ✭ 304 (+198.04%)
Mutual labels:  directory, cli
Project Explorer
πŸŽ‹A CLI tool to create an annotated tree visualization of any project
Stars: ✭ 485 (+375.49%)
Mutual labels:  cli, tree
Inert
Static file and directory handlers for hapi.js
Stars: ✭ 236 (+131.37%)
Mutual labels:  directory, file
Replace In File
A simple utility to quickly replace contents in one or more files
Stars: ✭ 369 (+261.76%)
Mutual labels:  cli, file
Coc Explorer
πŸ“ Explorer for coc.nvim
Stars: ✭ 722 (+607.84%)
Mutual labels:  tree, file
Voila
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.
Stars: ✭ 78 (-23.53%)
Mutual labels:  directory, file
Fcfilemanager
iOS File Manager on top of NSFileManager for simplifying files management. πŸ“‚
Stars: ✭ 862 (+745.1%)
Mutual labels:  directory, file
Get File
CLI and API to get a single file from Github repository.
Stars: ✭ 9 (-91.18%)
Mutual labels:  cli, file
Repository Tree
🌲Pretty display directory tree view of a GitHub repository.
Stars: ✭ 56 (-45.1%)
Mutual labels:  directory, tree
Pidtree
🚸 Cross platform children list of a PID.
Stars: ✭ 76 (-25.49%)
Mutual labels:  cli, tree
Typex
[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.
Stars: ✭ 128 (+25.49%)
Mutual labels:  cli, tree
Vidir
edit directory in $EDITOR (better than vim . with netrw)
Stars: ✭ 129 (+26.47%)
Mutual labels:  cli, file
Downgit
Create GitHub Resource Download Link
Stars: ✭ 936 (+817.65%)
Mutual labels:  directory, file
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (-28.43%)
Mutual labels:  cli, file

tree-node-cli

Lists the contents of directories in a tree-like format, similar to the Linux tree command. Both CLI and Node APIs are provided.

Tree is a recursive directory listing program that produces a depth indented listing of files. When a directory argument is given, tree lists all the files and/or directories found in the given directory.

Note: Symlinks are not followed.

Installation

$ npm install tree-node-cli
# or globally
$ npm install -g tree-node-cli

Example

$ tree -L 2 -I "node_modules"
tree-node-cli
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ __tests__
β”‚   β”œβ”€β”€ __fixtures__
β”‚   β”œβ”€β”€ __snapshots__
β”‚   β”œβ”€β”€ fixtures
β”‚   └── tree.test.js
β”œβ”€β”€ bin
β”‚   └── tree
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ tree.js
└── yarn.lock

CLI

$ tree [options] [path/to/dir]

Note: Use the command treee on Windows and Linux to avoid conflicts with built-in tree command.

The following options are available:

$ tree -h

  Usage: tree [options]

  Options:

    -V, --version             output the version number
    -a, --all-files           All files, include hidden files, are printed.
    --dirs-first              List directories before files.
    -d, --dirs-only           List directories only.
    -I, --exclude [patterns]  Exclude files that match the pattern. | separates alternate patterns. Wrap your entire pattern in double quotes. E.g. `"node_modules|coverage".
    -L, --max-depth <n>       Max display depth of the directory tree.
    -r, --reverse             Sort the output in reverse alphabetic order.
    -F, --trailing-slash      Append a '/' for directories.
    -h, --help                output usage information

API

const tree = require('tree-node-cli');
const string = tree('path/to/dir', options);

options is a configuration object with the following fields:

Field Default Type Description
allFiles false Boolean All files are printed. By default, tree does not print hidden files (those beginning with a dot).
dirsFirst false Boolean List directories before files.
dirsOnly false Boolean List directories only.
exclude [] Array An array of regex to test each filename against. Matching files will be excluded and matching directories will not be traversed into.
maxDepth Number.POSITIVE_INFINITY Number Max display depth of the directory tree.
reverse false Boolean Sort the output in reverse alphabetic order.
trailingSlash false Boolean Appends a trailing slash behind directories.
const string = tree('path/to/dir', {
  allFiles: true,
  exclude: [/node_modules/, /lcov/],
  maxDepth: 4,
});

console.log(string);

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].