Kfg Documentation
    Preparing search index...

    Function safeReadFile

    • Reads filePath, validating with validate. If the main file is missing or corrupted and a valid backup exists, restores the main file from the backup (with a warning) and returns the backup content.

      Parameters

      • filePath: string
      • options: { backup?: string | boolean; validate?: (content: string) => boolean } = {}

      Returns Promise<string | undefined>