• It reads a file and returns its content as a string. Uses utf-8 encoding by default.

    Parameters

    • path: string

      Path to the file to read.

    • Optional options: ReadOptions

      Options to read the file with (defaults to utf-8 encoding).

    Returns Promise<string>

    A promise that resolves with the content of the file.

  • It reads a file and returns its content as a string. Uses utf-8 encoding by default.

    Parameters

    • path: string

      Path to the file to read.

    • Optional options: ReadOptions

      Options to read the file with (defaults to utf-8 encoding).

    Returns Promise<Buffer>

    A promise that resolves with the content of the file.