Skip to content

walkFilesSync

walkFilesSync(dir, options?): string[]

Defined in: walk-files.ts:43

Every regular file under dir, as absolute paths in a stable (name-sorted, depth-first) order. Directories named in options.skip are not entered.

Symlinks found while walking are neither followed nor listed, so a link back up the tree can’t loop; dir itself is the caller’s choice and is followed if it is a symlink. A subdirectory that can’t be read is skipped; dir itself must be readable — its error propagates, since a typo’d root is a bug to surface, not an empty result. The tree is assumed not to change while it is walked: an entry swapped for a symlink mid-walk is not detected.

string

WalkFilesOptions = {}

string[]

import { walkFilesSync } from "@theholocron/fs-utils";
const sources = walkFilesSync(repoRoot, { skip: [".git", "node_modules", "dist"] });