@slimio/lstree
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

lstree

V0.1.0 Maintenance MIT

System Tree Printer as CLI (with a Node.js API). Stdout to the terminal the current working dir tree.

Requirements

  • Node.js v10 or higher.

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm install @slimio/lstree -g
# or
$ npx @slimio/lstree

Usage example

The package can be used as a binary command or as an API.

const tree = require("@slimio/lstree");
const lstree = tree({ depth: 2, ignore: ["test"] });

lstree(process.cwd()).catch(console.error);

To use it as a cmd:

$ lstree -d 2

Available script arguments are:

name type defaultValue
-d --depth number 0
-s --showfd boolean false
-i --ignore array []

API

three(options?: lstree.options): lstree

Create a new lstree clojure function. Available options are:

interface options {
    ignore?: string[];
    description?: Map<string, string>;
    depth?: number;
    showFilesDescriptor?: boolean;
}

Default ignored files and directories are: node_modules, coverage, docs, .nyc_output, .git.

lstree(dir: string, depth?: number): Promise< void >

Call lstree at the wanted location. lstree is an Asynchronous function.

lstree(__dirname).catch(console.error);

License

MIT

Package Sidebar

Install

npm i @slimio/lstree

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

11.9 kB

Total Files

6

Last publish

Collaborators

  • fraxken
  • alexandre.malaj