Function readFileIfExists

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

    Parameters

    • path: string

    Returns Promise<undefined | string>

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