1.3.1 • Published 3 years ago
@herberthe/filestree v1.3.1
FilesTree
A library for generating files tree.
Install
npm i @herberthe/filestree
# Or
yarn add @herberthe/filestree
# Or
pnpm add @herberthe/filestreeUsage
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 | stringstring[] | √ | - | The entry path | 
| depth | number | × | Infinity | The depth of tree | 
| filter | RegExpFilterFunctionType | × | - | 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 customexisted, theoutputoption would not work! | 
For more details, see Types Defination
LICENSE
MIT