WalkOptions | path-scurry (original) (raw)
Options provided to all walk methods.
Hierarchy
- WalkOptions
Index
Properties
Optional
filter
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.
Returns boolean
Optional
follow
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
Optional
walkFilter
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 filterto do that.
Asynchronous functions are not supported here.
Returns boolean
Optional
withFileTypes
withFileTypes?: boolean
Return results as PathBase objects rather than strings. When set to false, results are fully resolved paths, as returned byfullpath.
Default
true