Options
All
  • Public
  • Public/Protected
  • All
Menu

dree - v3.3.3

Index

Type aliases

Callback: (dirTree: Dree, stat: Stats) => void

Type declaration

    • (dirTree: Dree, stat: Stats): void
    • Callback used by scan when a file or dir is encountered

      Parameters

      • dirTree: Dree
      • stat: Stats

      Returns void

CallbackAsync: (dirTree: Dree, stat: Stats) => void | Promise<void>

Type declaration

    • (dirTree: Dree, stat: Stats): void | Promise<void>
    • Callback used by scanAsync when a file or dir is encountered

      Parameters

      • dirTree: Dree
      • stat: Stats

      Returns void | Promise<void>

SortDiscriminator: (x: string, y: string) => number

Type declaration

    • (x: string, y: string): number
    • Function used to sort paths

      Parameters

      • x: string
      • y: string

      Returns number

Functions

  • Returns a string representation of a Directory Tree given a path to a directory or file

    Parameters

    • path: string
    • Optional options: ParseOptions

      An object used as options of the function

    Returns string

    A string representing the Directory Tree of the given path

  • parseAsync(path: string, options?: ParseOptions): Promise<string>
  • Returns a promise to a string representation of a Directory Tree given a path to a directory or file

    Parameters

    • path: string
    • Optional options: ParseOptions

      An object used as options of the function

    Returns Promise<string>

    A promise to a string representing the Directory Tree of the given path

  • Returns a string representation of a Directory Tree given an object returned from scan

    Parameters

    • dirTree: Dree

      The object returned from scan, which will be parsed

    • Optional options: ParseOptions

      An object used as options of the function

    Returns string

    A string representing the object given as first parameter

  • Returns a promise to a string representation of a Directory Tree given an object returned from scan

    Parameters

    • dirTree: Dree

      The object returned from scan, which will be parsed

    • Optional options: ParseOptions

      An object used as options of the function

    Returns Promise<string>

    A promise to a string representing the object given as first parameter

  • Returns the Directory Tree of a given path. This function in synchronous.

    Parameters

    • path: string

      The path which you want to inspect

    • Optional options: ScanOptions

      An object used as options of the function

    • Optional onFile: Callback

      A function called when a file is added - has the tree object and its stat as parameters

    • Optional onDir: Callback

      A function called when a dir is added - has the tree object and its stat as parameters

    Returns Dree

    The directory tree as a Dree object

  • Returns in a promise the Directory Tree of a given path. This function is asynchronous.

    Parameters

    • path: string

      The path which you want to inspect

    • Optional options: ScanOptions

      An object used as options of the function

    • Optional onFile: CallbackAsync

      A function called when a file is added - has the tree object and its stat as parameters

    • Optional onDir: CallbackAsync

      A function called when a dir is added - has the tree object and its stat as parameters

    Returns Promise<Dree>

    A promise to the directory tree as a Dree object

Generated using TypeDoc