Interface Dree

Interface of an object representing a Directory Tree

interface Dree {
    children?: Dree[];
    descendants?: number;
    extension?: string;
    hash?: string;
    isEmpty?: boolean;
    isSymbolicLink: boolean;
    name: string;
    path: string;
    relativePath: string;
    size?: string;
    sizeInBytes?: number;
    stat?: Stats;
    type: Type;
}

Properties

children?: Dree[]

Optional. An array of Dree objects, containing all the children of the node

descendants?: number

Optional. The number of descendants of the node. Returned only if the node is a directory and [[descendants]] option is specified

extension?: string

Optional. The extension (without dot) of the node. Returned only if the node is a file

hash?: string

Optional. The hash of the node

isEmpty?: boolean

Optional. True if the node is a directory and contains no files and no directories

isSymbolicLink: boolean

A boolean with true value if the node is a symbolic link

name: string

The name of the node as a string

path: string

The absolute path of the node

relativePath: string

The relative path from the root of the node

size?: string

Optional. The size of the node, rounded to two decimals and appropriate unit

sizeInBytes?: number

Optional. The size in bytes of the node

stat?: Stats

Optional. The fs.lstat or fs.fstat of the node

type: Type

Values: Type.DIRECTORY or Type.FILE