@herberthe/filestree
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

FilesTree

version download GitHub license GitHub stars GitHub forks GitHub issues

A library for generating files tree.

Install

npm i @herberthe/filestree

# Or
yarn add @herberthe/filestree

# Or

pnpm add @herberthe/filestree

Usage

import { FilesTree } from "filestree"

const tree = new FilesTree({
    entry: "<Your Entry Path Here>",
    ...otherOptions
}).output()

console.log(tree)

Options

Option Type Required Default Description
entry string string[] - The entry path
depth number × Infinity The depth of tree
filter RegExp FilterFunctionType × - The filter for filename
path "relative" "absolute" × "absolute" The path type for output
flat boolean × false Flat the tree
output "path" "stats" × "path" The output type
custom <T extends any = any>(filename: string, path: string, stats: Stats) => T × - The custom output result function, If the optional function custom existed, the output option would not work!

For more details, see Types Defination

LICENSE

MIT

Dependents (1)

Package Sidebar

Install

npm i @herberthe/filestree

Weekly Downloads

0

Version

1.3.1

License

MIT

Unpacked Size

16.1 kB

Total Files

6

Last publish

Collaborators

  • herberthe