Static
generateGenerates a tree structure from a directory path or a provided Treegen structure.
Options for generating the tree structure.
Optional
dirThe path to the directory to scan.
Optional
ignoreAn array of regular expressions used to ignore specific files or directories.
Optional
rootThe name of the root directory in the structure. Default: 'root'
Optional
structure?: "\n" | `
${string}>${string}` | `${string}>${string}
` | `${string}>${string}
${string}>${string}`A Treegen structure to use (optional).
Optional
useIndicates whether to use type markers in the structure. Default: false
The root Node of the generated tree structure.
If the provided structure is not a valid Treegen structure.
Static
isChecks whether the provided structure is a valid Treegen structure.
The Treegen structure to validate.
The name of the root directory in the structure. Default: 'root'
True if the structure is valid, false otherwise.
Static
parseStatic
scanRecursively scans a directory and generates a Treegen structure representing its contents.
Options for scanning the directory and generating the structure.
Optional
dirThe path to the directory to scan. Default: './'
Optional
ignoreAn array of regular expressions used to ignore specific files or directories.
Optional
root?: stringThe name of the root directory in the structure. Default: 'root'
Optional
typeIndicates whether to include type markers in the structure for files and directories. Default: false
A Treegen structure representing the directory's contents.
Static
shouldDetermines whether a filename should be ignored based on a list of ignore rules.
The name of the file to check.
An array of regular expressions used to determine if the file should be ignored.
True if the filename should be ignored, false otherwise.
Generated using TypeDoc
The Treegen class provides functionality for generating and working with directory tree structures.