Skip to content

Path.rglobSync() method

pathlib-ts > Path > rglobSync

Performs a recursive glob search synchronously.

Signature:

rglobSync(pattern: string, options?: fs.GlobOptions): Path[];

Parameter

Type

Description

pattern

string

Glob pattern to evaluate recursively.

options

fs.GlobOptions

(Optional) Options forwarded to Node’s glob implementation.

Returns:

Path[]

Matching Path objects.

Delegates to Path.globSync() using a pattern that prepends the recursive "**" segment.

Discovering translation files synchronously

import { Path } from "pathlib-ts";
const repo = new Path("./packages");
const translations = repo.rglobSync("**.json");
console.log(translations.length);