If you prefer not to use method chaining, you can pass an Options object directly to crawlWithOptions.
Supported Options:
type Options = {
includeBasePath?: boolean;
includeDirs?: boolean;
normalizePath?: boolean;
maxDepth?: number;
maxFiles?: number;
resolvePaths?: boolean;
suppressErrors?: boolean;
group?: boolean;
onlyCounts?: boolean;
filters: FilterFn[];
resolveSymlinks?: boolean;
useRealPaths?: boolean;
excludeFiles?: boolean;
excludeSymlinks?: boolean;
exclude?: ExcludeFn;
relativePaths?: boolean;
pathSeparator: PathSeparator;
signal?: AbortSignal;
globFunction?: Function;
};
Example:
new fdir()
.crawlWithOptions("path/to/dir", {
includeBasePath: true,
})
.sync();