Function scanAsync

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

    Type Parameters

    • Node extends Dree = Dree

      The type of the tree object, which can be extended and changed by the onFile and onDir functions.

    Parameters

    • path: string

      The path which you want to inspect

    • Optionaloptions: ScanOptions

      An object used as options of the function

    • OptionalonFile: CallbackAsync<Node>

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

    • OptionalonDir: CallbackAsync<Node>

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

    Returns Promise<Node>

    A promise to the directory tree as a Dree object