Interface WalkOptions

Options provided to all walk methods.

Hierarchy

  • WalkOptions

Properties

filter?: ((entry: PathBase) => boolean)

Type declaration

    • (entry: PathBase): boolean
    • Only return entries where the provided function returns true.

      This will not prevent directories from being traversed, even if they do not pass the filter, though it will prevent directories themselves from being included in the result set. See walkFilter

      Asynchronous functions are not supported here.

      By default, if no filter is provided, all entries and traversed directories are included.

      Parameters

      Returns boolean

follow?: boolean

Attempt to read directory entries from symbolic links. Otherwise, only actual directories are traversed. Regardless of this setting, a given target path will only ever be walked once, meaning that a symbolic link to a previously traversed directory will never be followed.

Setting this imposes a slight performance penalty, because readlink must be called on all symbolic links encountered, in order to avoid infinite cycles.

Default

false

walkFilter?: ((entry: PathBase) => boolean)

Type declaration

    • (entry: PathBase): boolean
    • Only traverse directories (and in the case of follow being set to true, symbolic links to directories) if the provided function returns true.

      This will not prevent directories from being included in the result set, even if they do not pass the supplied filter function. See filter to do that.

      Asynchronous functions are not supported here.

      Parameters

      Returns boolean

withFileTypes?: boolean

Return results as PathBase objects rather than strings. When set to false, results are fully resolved paths, as returned by fullpath.

Default

true

Generated using TypeDoc