Kfg Documentation
    Preparing search index...

    Function safeReadFileSync

    • 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. Returns undefined when neither source is usable.

      Parameters

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

      Returns string | undefined