Skip to main content

Function: readTextFileIfExists()

readTextFileIfExists(filePath: string): string | null

Defined in: _internal/repository-text-files.ts:186

Reads a UTF-8 text file and returns null when the file cannot be read. Results are cached to avoid repeated disk I/O for the same file path.

Parameters​

filePath​

string

Absolute path to the file to read

Returns​

string | null

File contents or null if file cannot be read