Function readFileIfExists

  • Reads a file if it exists, or just return undefined.

    Parameters

    • path: string

    Returns Promise<string | undefined>

    The file contents as a string if the file exists, otherwise undefined.